Skip to content

Instantly share code, notes, and snippets.

@rbriank
Created July 9, 2012 20:03
Show Gist options
  • Save rbriank/3078571 to your computer and use it in GitHub Desktop.
Save rbriank/3078571 to your computer and use it in GitHub Desktop.
monitor a website and do something if it's down
alias monitor='while true; do if [ "$(wget -T 10 -t 1 https://some.server.com -O /dev/null -o /dev/stdout | grep 200.OK)" = "" ]; then "$(..restart...)"; echo "restarted at `date`"; fi; echo "last checked at `date`"; sleep 1800; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment