Last active
September 28, 2015 05:27
-
-
Save hugomaiavieira/1391206 to your computer and use it in GitHub Desktop.
Script para verificar se a internet voltou. Quando volta, toca um alarme.
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
# Verify it a website is back, or the internet access is back. When it is back, | |
# an alarm rings. | |
# | |
# Depends of ticktimer: https://github.com/algorich/ticktimer | |
# | |
# Author: Hugo Maia Vieira <[email protected]> | |
# | |
while : | |
do | |
wget -q -O /dev/null http://www.google.com.br | |
if [ "$?" == 0 ] | |
then | |
ticktimer 0:1 | |
break | |
fi | |
# wait for 1 minute to try again | |
sleep 3600 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment