Created
October 27, 2010 15:02
-
-
Save RichardBronosky/649196 to your computer and use it in GitHub Desktop.
hammers a url with various user agents
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
url=http://test.www.clarkhoward.com/ | |
agents=( | |
'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16' | |
'Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16' | |
'BlackBerry9700/5.0.0.602 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/102' | |
) | |
trap "exit" INT # Ctrl-C should exit the script, not simply break the for/while loop | |
while true; do | |
( | |
echo; | |
date; | |
for agent in "${agents[@]}"; do | |
echo "curl -s -I -A '$agent' $url"; | |
curl -s -I -A "$agent" $url | tr -d '\r'; | |
done; | |
sleep 1; | |
) | tee -a /tmp/mobile_access.log | grep '^L'; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment