docker-minecraft-server/health.sh

15 lines
377 B
Bash
Raw Normal View History

2020-05-20 15:17:58 +02:00
#!/bin/bash
. ${SCRIPTS:-/}start-utils
2020-05-20 15:17:58 +02:00
2020-07-09 20:54:34 -05:00
if isTrue "${DISABLE_HEALTHCHECK}"; then
echo "Healthcheck disabled"
exit 0
elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
2020-05-20 15:17:58 +02:00
echo "Java process suspended by Autopause function"
exit 0
else
mc-monitor status --host localhost --port $SERVER_PORT
exit $?
fi