healthcheck.sh 276 B

123456789
  1. #!/bin/sh
  2. # health check to allow 404 status code as valid
  3. STATUSCODE=$(curl --silent --output /dev/null --write-out "%{http_code}" $1)
  4. # will be 000 on non-http error (e.g. connection failure)
  5. if test $STATUSCODE -ge 500 || test $STATUSCODE -lt 200; then
  6. exit 1
  7. fi
  8. exit 0