Skip to content

Instantly share code, notes, and snippets.

@ubermuda
Created January 26, 2015 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ubermuda/2d340ff7f7d9bc6ea412 to your computer and use it in GitHub Desktop.
Save ubermuda/2d340ff7f7d9bc6ea412 to your computer and use it in GitHub Desktop.
#!/bin/bash
URL=$1
EXPECTED=${2:-200}
if [ -z "$URL" ]; then
echo "Usage: $0 url [expected_code]"
exit 1
fi
if [[ $(curl -o /dev/null --silent --head --write-out '%{http_code}\n' $URL) != "$EXPECTED" ]]; then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment