Created
March 10, 2016 22:06
-
-
Save glamrock/b2975a0e9e88601cf3ef to your computer and use it in GitHub Desktop.
Check if list of sites are up or down
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
#!/bin/bash | |
# Down verification via dns/dig by Griffin ^_^ | |
# basically the same thing as before, just running the "down" sites through dig | |
# to make sure they are really not available. Sites that pass this test | |
# are placed in a third site category, as they may be unavailable or blocked in | |
# the test location, but have defined nameservers in DNS records. | |
readarray -t array < sitesdown.txt | |
for i in "${array[@]}" | |
do ( | |
if [[ $(dig @8.8.8.8 +short NS "$i") ]] | |
then echo "$i" >> sitemeh.txt | |
fi | |
) | |
done |
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
#!/bin/bash | |
# Up/Down checker by Griffin ^_^ | |
# Run both with the following command (making sure to change the folder name): | |
# find ~/by -type d -exec sh -c 'cd "{}" ; ~/by/sitesup.sh ;' \; | |
readarray -t array < *seeds.txt | |
for i in "${array[@]}" | |
do ( | |
if curl -s --head --request GET "$i" | grep -E '200|300|301|302' > /dev/null | |
then echo "$i" >> sitesup.txt | |
else echo "$i" >> sitesdown.txt | |
fi | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment