From df7d6c298a53d452fd0ecc474971381d337b8a99 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 13 Nov 2021 18:42:00 -0600 Subject: [PATCH] fix: defaulted SERVER_PORT for health and autopause #1120 --- bin/mc-health | 6 +++--- scripts/start-autopause | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/mc-health b/bin/mc-health index 09aa9198..9c39ba4a 100755 --- a/bin/mc-health +++ b/bin/mc-health @@ -1,7 +1,7 @@ #!/bin/bash -# shellcheck source=../start-utils -. ${SCRIPTS:-/}start-utils +# shellcheck source=../scripts/start-utils +. "${SCRIPTS:-/}start-utils" if isTrue "${DISABLE_HEALTHCHECK}"; then echo "Healthcheck disabled" @@ -10,6 +10,6 @@ elif isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -ax -o stat,comm | grep 'java' | echo "Java process suspended by Autopause function" exit 0 else - mc-monitor status --host localhost --port $SERVER_PORT + mc-monitor status --host localhost --port "${SERVER_PORT:-25565}" exit $? fi diff --git a/scripts/start-autopause b/scripts/start-autopause index 5297272c..02b33d0a 100755 --- a/scripts/start-autopause +++ b/scripts/start-autopause @@ -1,9 +1,15 @@ #!/bin/bash -. ${SCRIPTS:-/}start-utils +# shellcheck source=start-utils +. "${SCRIPTS:-/}start-utils" + +: "${SERVER_PORT:=25565}" +export SERVER_PORT log "Autopause functionality enabled" +isDebugging && set -x + cp /autopause/knockd-config.cfg /tmp/knockd-config.cfg # update server port to listen to