Skip to content

Instantly share code, notes, and snippets.

@brookemckim
Created August 15, 2012 15:48
Show Gist options
  • Save brookemckim/3361131 to your computer and use it in GitHub Desktop.
Save brookemckim/3361131 to your computer and use it in GitHub Desktop.
#!/bin/bash
host=$1
response_code=$(curl -sL -w "%{http_code}" --connect-timeout 10 --digest -X PUT $host -o /dev/null)
case $response_code in
[2][0-9][0-9]) echo "OK"; exit 0;;
*) echo "Critical $response_code"; exit 3;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment