Skip to content

Commit

Permalink
Merge pull request #2274 from appveyor/fix_ipaddresses
Browse files Browse the repository at this point in the history
Fix IP discovery in enable-ssh.sh
  • Loading branch information
FeodorFitsner authored Apr 24, 2018
2 parents e725cc2 + 0055641 commit 328c269
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/enable-ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sudo ufw allow OpenSSH > /dev/null 2>&1
EXT_IP=$(curl -sf https://www.appveyor.com/tools/my-ip.aspx)

# get ip address of management network interface and figure out corresponding port on NAT
INT_IP=$(hostname --ip-address)
INT_IP=$(ip -o -4 addr show up primary scope global | ( read -r num dev fam addr rest; echo ${addr%/*}; ))
IFS='.' read -r -a INT_IP_ARR <<< "$INT_IP"
PORT=$(( 22000 + (${INT_IP_ARR[2]} - 0) * 256 + ${INT_IP_ARR[3]} ))

Expand Down

0 comments on commit 328c269

Please sign in to comment.