Skip to content

Instantly share code, notes, and snippets.

@sandeepkunkunuru
Last active August 29, 2015 14:02
Show Gist options
  • Save sandeepkunkunuru/040af3ad7788f154a176 to your computer and use it in GitHub Desktop.
Save sandeepkunkunuru/040af3ad7788f154a176 to your computer and use it in GitHub Desktop.
Ping Website
#!/bin/sh
rm -f response.html
wget $1 -o response.html
grep -qs "401 Unauthorized" response.html
OUT=$?
if [ $OUT -eq 0 ];then
echo "$1 is up"
exit 0
else
echo "$1 is down"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment