overleaf-cep/services/docstore/test/acceptance/deps/healthcheck.sh
Jakob Ackermann 5404dcb93d [misc] update build scripts (#23316)
* [misc] update build scripts

* [misc] make shellcheck happy

GitOrigin-RevId: 343655fda54aa7e835dd666dcd4218d61c58fd09
2025-02-04 09:04:37 +00:00

9 lines
282 B
Bash

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