2020-05-20 13:17:58 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-11-14 00:42:00 +00:00
|
|
|
# shellcheck source=../scripts/start-utils
|
|
|
|
. "${SCRIPTS:-/}start-utils"
|
2021-11-24 20:30:20 +00:00
|
|
|
if [ -f /data/.mc-health.env ]; then
|
|
|
|
. /data/.mc-health.env
|
|
|
|
fi
|
2020-05-20 13:17:58 +00:00
|
|
|
|
2020-07-10 01:54:34 +00:00
|
|
|
if isTrue "${DISABLE_HEALTHCHECK}"; then
|
|
|
|
echo "Healthcheck disabled"
|
|
|
|
exit 0
|
2020-12-31 19:15:44 +00:00
|
|
|
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
|
2020-05-20 13:17:58 +00:00
|
|
|
echo "Java process suspended by Autopause function"
|
|
|
|
exit 0
|
|
|
|
else
|
2021-11-24 20:30:20 +00:00
|
|
|
mc-monitor status "${MC_HEALTH_EXTRA_ARGS[@]}" --host localhost --port "${SERVER_PORT:-25565}"
|
2020-05-20 13:17:58 +00:00
|
|
|
exit $?
|
|
|
|
fi
|