Skip to content

Instantly share code, notes, and snippets.

@huettern
Created February 9, 2018 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huettern/6c1dc38e293e1bc07053ad1ac5e20231 to your computer and use it in GitHub Desktop.
Save huettern/6c1dc38e293e1bc07053ad1ac5e20231 to your computer and use it in GitHub Desktop.
#/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