Skip to content

Instantly share code, notes, and snippets.

@muxun
Forked from judoole/smoketest.sh
Created April 16, 2020 07:19
Show Gist options
  • Save muxun/69290145e40bd19fd5aa54d7951b49b8 to your computer and use it in GitHub Desktop.
Save muxun/69290145e40bd19fd5aa54d7951b49b8 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