Created
July 30, 2012 11:24
-
-
Save judoole/3206310 to your computer and use it in GitHub Desktop.
Smoketest shell script via curl
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 | |
if [ -z "$1" ] | |
then | |
echo "usage: smoketest.sh <url>" | |
exit 1 | |
fi | |
status=`curl --silent --head $1 | head -1 | cut -f 2 -d' '` | |
if [ "$status" != "200" ] | |
then | |
echo "status was other than '200': was '$status'" | |
exit 1 | |
fi | |
if [ ! -e "reports" ] | |
then | |
mkdir "reports" | |
fi | |
#put the xml version of the page into a file | |
curl --silent $1 > reports/smoke.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment