Last active
November 13, 2015 12:09
-
-
Save bradleygolden/64b338e9a44372feab0c to your computer and use it in GitHub Desktop.
Tests the http response header of a given set of URIs
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 | |
| # to run: $ bash <ip> <port> | |
| host=$1 | |
| port=$2 | |
| while read LINE; do | |
| if [ ! ${LINE:0:1} == "#" ] | |
| then | |
| curl -o /dev/null --silent --get --write-out '%{http_code}' "$host:$port$LINE" | |
| echo " $LINE" | |
| else | |
| echo " $LINE" | |
| fi | |
| done < url-list.txt |
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
| #should pass | |
| /favicon.ico | |
| /google.gif | |
| /index.html | |
| /monorail.jpg | |
| /pic.html | |
| /skype.png | |
| / | |
| #should fail | |
| /whoops.ico | |
| /googl.gif | |
| /indx.html | |
| /monoril.jpg | |
| /pc.html | |
| /skyp.png | |
| #should pass | |
| /test/ | |
| /test/dir/ | |
| /test/dir/endtoend.pdf | |
| /test/dir/index.html | |
| /test/dir/testpage.html | |
| #should fail | |
| /tests/ | |
| /test/dirs/ | |
| /test/dir/endtond.pdf | |
| /test/dir/indx.html | |
| /test/dir/testpae.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment