Last active
September 29, 2015 10:47
-
-
Save grapefrukt/1589043 to your computer and use it in GitHub Desktop.
IGF Main page refresher
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 | |
delay=180 | |
while [ 1 ] | |
do | |
curl --silent --output igf.tmp "http://www.igf.com/" | |
if [[ -e igf.tmp ]] ;then | |
if [[ -e igf.tmp.1 ]] ;then | |
diff igf.tmp igf.tmp.1 | |
if [[ $? -ne 0 ]]; then | |
clear | |
date +"[%H:%M] File changed! (press ctrl+c to quit)" | |
while [ 1 ] | |
do | |
printf "\007" | |
sleep 1 | |
done | |
mv igf.tmp igf.tmp.1 | |
else | |
date +"[%H:%M] Nothing happened" | |
fi | |
else | |
echo "first run" | |
fi | |
mv igf.tmp igf.tmp.1 | |
fi | |
#sleep 60 # refresh delay in seconds | |
for countdown in $(eval echo {$delay..1}); do | |
printf " Updating in $countdown... "\\r | |
sleep 1 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment