Created
February 22, 2022 18:47
-
-
Save ebadi/71b7afba050d29e80127ffb56001a501 to your computer and use it in GitHub Desktop.
Check a url for changes every x second
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
filename1="out.html" | |
filename2="tmp.html" | |
while true | |
do | |
curl -L 'https://blah' > "$filename1" | |
m1=($(md5sum "$filename1")) | |
m2=($(md5sum "$filename2")) | |
echo "$m1 & $m2" | |
if [ "$m1" != "$m2" ] ; then | |
echo "ERROR: File has changed!" >&2 | |
espeak "Found an open position in the queue." | |
diff "$filename1" "$filename2" | |
cp "$filename1" "$filename2" | |
exit 1 | |
fi | |
sleep 60 | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment