Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- check_urls () {
- urls_file_path=$(pwd)/urls.txt
- echo $urls_file_path
- if [ -f $urls_file_path ]
- then
- urls_list=$( cat $urls_file_path )
- while read LINE; do
- url_response_status=$(curl -Is $LINE | head -1)
- STATUS=$(curl -s -o /dev/null -w '%{http_code}' $LINE)
- echo $LINE $STATUS
- if [[ $STATUS =~ ^[0,4,5] ]]
- then
- echo Error
- break
- fi
- done < $urls_file_path
- else
- echo The file $urlf_file_path doesn\'t exists
- fi
- }
- check_urls
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement