Skip to content

Instantly share code, notes, and snippets.

@cheeseprocedure
Created September 27, 2014 01:38
Show Gist options
  • Save cheeseprocedure/8b786b2dfc84b7a49421 to your computer and use it in GitHub Desktop.
Save cheeseprocedure/8b786b2dfc84b7a49421 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Throw an alert when a page's contents have changed
#
# Requires https://github.com/alloy/terminal-notifier
DELAY="30"
URL="https://ftp.gnu.org/gnu/bash/bash-3.2-patches/?C=M;O=D"
CHECKSUM="d1476050bb854ad1d33ce539cd5214fc5c9802d3"
while true; do
if [[ `curl -s "${URL}" | shasum` == "${CHECKSUM} -" ]]; then
echo "`date` - checksum has not changed - sleeping..."
else
terminal-notifier -message "bash updates RELEASED @ ${URL}" -title 'Bash updates!'
break
fi
sleep ${DELAY}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment