Skip to content

Instantly share code, notes, and snippets.

@judoole
Created July 30, 2012 11:24
Show Gist options
  • Save judoole/3206310 to your computer and use it in GitHub Desktop.
Save judoole/3206310 to your computer and use it in GitHub Desktop.
Smoketest shell script via curl
#!/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