Skip to content

Instantly share code, notes, and snippets.

@mtdefelice
Created June 30, 2020 06:04
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 mtdefelice/a2655f806a2936dced645e3e6f48889d to your computer and use it in GitHub Desktop.
Save mtdefelice/a2655f806a2936dced645e3e6f48889d to your computer and use it in GitHub Desktop.
#!/bin/bash
_LOCALPORT=8080
_SUBDOMAIN=weatherclub
# Wait for network connectivity. 8.8.8.8 is one of Google's DNS servers.
ping -c3 8.8.8.8
while [ $? -ne 0 ]; do
echo Waiting for network connectivity ...
sleep 30
ping -c3 8.8.8.8
done
# Launch autossh
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -R ${_SUBDOMAIN}:80:localhost:${_LOCALPORT} serveo.net
@mtdefelice
Copy link
Author

On your Raspberry Pi, save this script and run either on login or in /etc/rc.local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment