Last active
August 29, 2015 14:05
-
-
Save nkabir/86f5eb131bced21761ad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ -z "${1}" ]; then | |
echo "usage: ${0} {site uri eg http://google.com}" | |
exit 1 | |
fi | |
curl "${1}" > /dev/null 2>&1 | |
is_down="$?" | |
if [ ! $is_down -eq 0 ]; then | |
echo "site is down" | |
# or send some email; sound alarm; etc. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment