Created
July 9, 2012 20:03
-
-
Save rbriank/3078571 to your computer and use it in GitHub Desktop.
monitor a website and do something if it's down
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
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