Skip to content

Instantly share code, notes, and snippets.

@energee
Last active November 17, 2021 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save energee/acc737c531a3660e3cf9e0905482701a to your computer and use it in GitHub Desktop.
Save energee/acc737c531a3660e3cf9e0905482701a to your computer and use it in GitHub Desktop.
Checks a page for new content, and if it has changed refreshes chromium
#!/bin/bash
site="https://menu.lolev.beer"
previous=`cat checksum`
current=`curl -s $site | md5sum`
echo "$current" > checksum
echo "Previous contents of page: $previous"
echo "Current contents of page: $current"
if [ "$previous" != "$current" ]
then
`DISPLAY=:0.0 xdotool key ctrl+R`
echo "Page refreshing"
else
echo "Content matches, skipping refresh"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment