Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #check http header/check site is live or die
- for i in `cat $1`; do
- check=`curl -Isw "%{http_code}" $i -o /dev/null`
- if [[ $check =~ '200' ]];
- then
- echo "$i - Live - $check"
- echo "$i">>200.txt
- elif [[ $check =~ '302' ]];
- then
- echo "$i - Live - $check"
- echo "$i">>302.txt
- elif [[ $check =~ '301' ]];
- then
- echo "$i - Live - $check"
- echo "$i">>301.txt
- elif [[ $check =~ '404' ]];
- then
- echo "$i - Live - $check"
- echo "$i">>404.txt
- elif [[ $check =~ '505' ]];
- then
- echo "$i - Live - $check"
- echo "$i">>505.txt
- else
- echo "$i - DIE - $check" | tee -a DIE.txt
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement