Skip to content

Instantly share code, notes, and snippets.

@nkabir
Last active August 29, 2015 14:05
Show Gist options
  • Save nkabir/86f5eb131bced21761ad to your computer and use it in GitHub Desktop.
Save nkabir/86f5eb131bced21761ad to your computer and use it in GitHub Desktop.
#!/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