Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A script to verify if my connection is up and running. Put it to run in your crontab and you can have logs of your broadband internet connection, for example. Call $ > output.log
datetime=`date +%Y-%m-%d\ %H:%M:%S`
my_ip=`curl -s`
if [ $exit_code == 0 ]; then
echo $datetime [ONLINE] $my_ip
echo $datetime [OFFLINE] Exit code: $exit_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.