Created
October 4, 2015 06:18
-
-
Save knmkr/6f969eb40b40ac00470d to your computer and use it in GitHub Desktop.
Healthchek URL with auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| AUTH_USER=user | |
| AUTH_PASS=pass | |
| URL=http://www.example.com | |
| OUT=/tmp/log/healthcheck/example.com | |
| STATUS=$(curl -L --anyauth --user ${AUTH_USER}:${AUTH_PASS} ${URL} -o ${OUT} -s -w '%{http_code}\n') | |
| if [[ "${STATUS}" != 200 ]]; then | |
| echo Not 200 on ${URL} | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment