shedali
4/9/2014 - 1:25 PM

crawl site for broken links

crawl site for broken links

for i in `curl shedali.co.uk | grep -o -E 'href="([^"#]+)"' | cut -d '"' -f2 | sort | uniq`; do bash isup.sh $i; done
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"