Created
May 3, 2015 23:03
-
-
Save bitst0rm/ca882768c537d619d391 to your computer and use it in GitHub Desktop.
Simple script to generate host list for https://github.com/Owyn/HandyImage
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
#!/usr/bin/sh | |
# Script to generate host list and check for dead hosts | |
echo "Generating supported host list..." | |
sed -n 's/.*case "\(.*\)":.*/\1/p' HandyImage.user.js | sort | uniq > supported-host-list.txt | |
read -p "Do you want to check broken hosts? (y/n)" RESP | |
if [ "$RESP" = "y" ]; then | |
echo "Checking broken hosts..." | |
while read URL; do | |
RESULT=$(curl -s -o /dev/null --connect-timeout 2 -w%{http_code} ${URL}) | |
echo "[${RESULT}] ${URL}" | |
done < supported-host-list.txt | sort > broken-host-list.txt | |
fi | |
echo "Done." | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment