Skip to content

Instantly share code, notes, and snippets.

@ebadi
Created February 22, 2022 18:47
Show Gist options
  • Save ebadi/71b7afba050d29e80127ffb56001a501 to your computer and use it in GitHub Desktop.
Save ebadi/71b7afba050d29e80127ffb56001a501 to your computer and use it in GitHub Desktop.
Check a url for changes every x second
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