Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ if [[ -n "${PUBLIC_HOST_ADDR}" && -n "${PUBLIC_HOST_PORT}" ]]; then
echo "====REMOTE FINGERPRINT===="
cat ${KNOWN_HOSTS}
echo "====REMOTE FINGERPRINT===="

localhostIP=$(/sbin/ip route|awk '/default/ { print $3 }')
echo "hosts IP (according to /sbin/ip route) is: ${localhostIP}"
echo "=> Setting up the reverse ssh tunnel"
sshpass -p ${ROOT_PASS} autossh -M 0 -NgR 1080:localhost:${PROXY_PORT} root@${PUBLIC_HOST_ADDR} -p ${PUBLIC_HOST_PORT}
sshpass -p ${ROOT_PASS} autossh -M 0 -NgR 1080:${localhostIP}:${PROXY_PORT} root@${PUBLIC_HOST_ADDR} -p ${PUBLIC_HOST_PORT}
else
echo "=> Running in public host mode"
if [ ! -f /.root_pw_set ]; then
Expand Down