Instantly share code, notes, and snippets.

Embed
What would you like to do?
#/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