Created
June 30, 2020 06:04
-
-
Save mtdefelice/a2655f806a2936dced645e3e6f48889d to your computer and use it in GitHub Desktop.
This file contains 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 | |
_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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On your Raspberry Pi, save this script and run either on login or in /etc/rc.local.