Created
December 9, 2013 16:09
-
-
Save xeraa/7874694 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
#!/bin/bash | |
# Check if our important or publicly communicated URLs are available | |
set -e | |
URLS=( | |
"http://test.com" | |
"http://test.com/foo" | |
) | |
STATUS=0 | |
for URL in "${URLS[@]}" | |
do | |
if curl --output /dev/null --silent --head --fail "$URL" | |
then | |
echo -e "\x1B[0;32mURL exists: $URL" | |
else | |
echo -e "\x1B[0;31mURL does not exist: $URL" | |
STATUS=1 | |
fi | |
done | |
echo -e "\x1B[0mExit code $STATUS" # Reset the color | |
exit $STATUS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment