Created
August 19, 2019 11:11
-
-
Save aozimkov/280e5223809c39f32b9252928d7382f0 to your computer and use it in GitHub Desktop.
Easy bash script check url status code from file
This file contains hidden or 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 | |
checker(){ | |
URL=$1 | |
STATUS=`curl -s -o /dev/null -w "%{http_code}" $URL` | |
if [ $STATUS -eq 200 ] | |
then | |
echo "OK" | |
else | |
echo $URL | |
fi | |
} | |
while read URL; do checker "$URL"; done < $1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment