Created
February 9, 2018 10:55
-
-
Save huettern/6c1dc38e293e1bc07053ad1ac5e20231 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Outside port to be openned for incomming ssh connections | |
PORT=12322 | |
# Host Name and Port of the announce destination using SSH | |
HOST=host.com | |
HOST_PORT=22 | |
curl -s http://whatismyip.akamai.com/ | ssh outpost@$HOST -p$HOST_PORT "cat > ~/outpost_ip.txt; echo ":$PORT" >> ~/outpost_ip.txt" | |
# Make sure port is forwarded | |
upnpc -a `ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'` 22 $PORT TCP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment