Skip to content

Instantly share code, notes, and snippets.

@cwilper
Created July 10, 2017 15:02
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 cwilper/13de42cacbe7eed8545ee1d5f0f69d0a to your computer and use it in GitHub Desktop.
Save cwilper/13de42cacbe7eed8545ee1d5f0f69d0a to your computer and use it in GitHub Desktop.
Checks if a given url returns 200 ok and returns 0 if so, returns 1 (error) otherwise
#!/bin/sh
curl -Ssf "$1" > /dev/null
if [[ $? -ne 0 ]]; then
echo "Error: Non-200 returned for url $1"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment