Skip to content

Instantly share code, notes, and snippets.

@navinpai
Created March 16, 2015 20:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navinpai/7e11d2358848a590ed93 to your computer and use it in GitHub Desktop.
Save navinpai/7e11d2358848a590ed93 to your computer and use it in GitHub Desktop.
script to check how many of the top 100 sites are blocked by CyberRoam
#!/bin/bash
# To get the data
# curl -s -O http://s3.amazonaws.com/alexa-static/top-1m.csv.zip ; unzip -q -o top-1m.csv.zip top-1m.csv ; head -1000 top-1m.csv | cut -d, -f2 | cut -d/ -f1 > topsites.txt
# Process Data
cat topsites.txt | while read line
do
echo $line
count=$( wget -T 30 -qO- $line | grep -c "><font class=accessdeniedcategoryfont>")
if [ "$count" != "0" ]
then
echo "^BLOCKED"
echo $line >> blocked.txt
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment