diff --git a/scripts/enable-ssh.sh b/scripts/enable-ssh.sh index 4813aa3..c029cdc 100644 --- a/scripts/enable-ssh.sh +++ b/scripts/enable-ssh.sh @@ -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]} ))