Created
September 23, 2014 19:55
-
-
Save niallsmart/7b1a17b2ca76f92d83fe to your computer and use it in GitHub Desktop.
Check URL status
This file contains 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 | |
while read url; do | |
output=`curl -sI "$url" 2>&1 | head -1` | |
if ! echo $output | grep '200 OK' >/dev/null; then | |
echo $url | |
echo $output | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment