Last active
August 29, 2015 14:02
-
-
Save sandeepkunkunuru/040af3ad7788f154a176 to your computer and use it in GitHub Desktop.
Ping Website
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
#!/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