Created
October 23, 2011 20:52
-
-
Save matthiasr/1307877 to your computer and use it in GitHub Desktop.
check if 28C3 presale is online. add this as a cronjob.
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/sh | |
URLS="http://presale.events.ccc.de/ https://presale.events.ccc.de/" | |
MAILTO="foo@example.com bar@example.org" | |
TIMEOUT=10 | |
for URL in $URLS; do | |
DONEFILE=${PWD}/.urlcheckdone.$(echo ${URL} | sed -e 's/[^-[:alnum:]_]/_/g') | |
[ -f ${DONEFILE} ] && continue | |
if [ ! $(curl -s ${URL} --connect-timeout ${TIMEOUT} |wc -c) -eq 0 ]; then | |
{ cat << EOF | |
${URL} just came online! | |
Love, | |
your checkerbot. | |
EOF | |
} | mail -s "${URL} online check" ${MAILTO} | |
touch ${DONEFILE} | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment