Last active
August 29, 2015 13:58
-
-
Save shedali/10270192 to your computer and use it in GitHub Desktop.
crawl site for broken links
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
for i in `curl shedali.co.uk | grep -o -E 'href="([^"#]+)"' | cut -d '"' -f2 | sort | uniq`; do bash isup.sh $i; done |
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
if [[ $1 == http://* ]] ; | |
then | |
url=$1 | |
else | |
url=http://www.shedali.co.uk$1; | |
fi | |
if curl -s --head $url | grep "200 OK\|302 Moved Temporarily\|301 Moved*" | |
then | |
echo "$url OK" | |
else | |
echo "- - - $url FAIL" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment