Created
February 7, 2014 22:37
-
-
Save alexlovelltroy/8873455 to your computer and use it in GitHub Desktop.
An expanded bash oneliner to use on a mac and notify you when the internet comes back
This file contains hidden or 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
INTERNET=1 # We have internet access | |
while 1 ; do | |
export OLD_INTERNET=$INTERNET; | |
sleep 5 && dig vpn.activision.com +short && export INTERNET=1 || export INTERNET=0; | |
if [ $OLD_INTERNET -lt $INTERNET ]; then | |
say "We have internet"; | |
fi; | |
if [ $OLD_INTERNET -gt $INTERNET ]; then | |
say "We lost internet"; | |
fi; | |
echo "`date` WAS $OLD_INTERNET AND IS $INTERNET"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment