Skip to content

Commit f20ed50

Browse files
committed
fix: refactor deploy-node script to use resolve_host function for IP resolution
1 parent 2aa6696 commit f20ed50

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

scripts/deploy-node.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1515
SSH_KEY="$HOME/.ssh/id_ed25519_clawnet"
1616
SSH_OPTS="-i $SSH_KEY -o ConnectTimeout=15 -o BatchMode=yes"
1717

18-
# Node name → IP map
19-
declare -A NODE_IPS=(
20-
[alex]="173.249.46.252"
21-
[bess]="167.86.93.216"
22-
)
18+
resolve_host() {
19+
case "$1" in
20+
alex) echo "173.249.46.252" ;;
21+
bess) echo "167.86.93.216" ;;
22+
*) echo "$1" ;;
23+
esac
24+
}
2325

2426
deploy_one() {
2527
local target="$1"
26-
# Resolve name to IP if needed
27-
local host="${NODE_IPS[$target]:-$target}"
28+
local host
29+
host=$(resolve_host "$target")
2830

2931
echo ""
3032
echo "╔══════════════════════════════════════════════════════╗"

0 commit comments

Comments
 (0)