From b5596f62961c7e1c4e9de8891819580d6205b988 Mon Sep 17 00:00:00 2001 From: sean0407 Date: Thu, 15 Oct 2026 03:39:01 +0800 Subject: [PATCH] Persist autopause watchdog default (#4325) --- scripts/start-autopause | 11 ----------- scripts/start-configuration | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/start-autopause b/scripts/start-autopause index b8d0dfa9..148dd493 100755 --- a/scripts/start-autopause +++ b/scripts/start-autopause @@ -53,17 +53,6 @@ if [[ "$AUTOPAUSE_KNOCK_INTERFACE" == "lo" ]] ; then logWarning " Continuing with this setting." fi -if [[ -n "$MAX_TICK_TIME" && "$MAX_TICK_TIME" != "-1" ]] ; then - logWarning "MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)" -elif [[ -z "$MAX_TICK_TIME" ]] ; then - MAX_TICK_TIME=-1 - if versionLessThan 1.8.1; then - # 10 years - MAX_TICK_TIME=315360000000 - fi - export MAX_TICK_TIME -fi - # seq_cooldown cannot be larger than AUTOPAUSE_TIMEOUT_KN, otherwise the server may # become paused while knockd is still ignoring packets, preventing players from joining. let COOLDOWN=$AUTOPAUSE_TIMEOUT_KN/2 diff --git a/scripts/start-configuration b/scripts/start-configuration index 8a0fcda6..d7aef2ee 100755 --- a/scripts/start-configuration +++ b/scripts/start-configuration @@ -207,6 +207,17 @@ if isTrue "${VERSION_FROM_MODRINTH_PROJECTS:-}" && [[ ${MODRINTH_PROJECTS:-} ]]; fi if isTrue "${ENABLE_AUTOPAUSE}"; then + if [[ -n "${MAX_TICK_TIME:-}" && "$MAX_TICK_TIME" != "-1" ]] ; then + logWarning "MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)" + elif [[ -z "${MAX_TICK_TIME:-}" ]] ; then + MAX_TICK_TIME=-1 + if versionLessThan 1.8.1; then + # 10 years + MAX_TICK_TIME=315360000000 + fi + export MAX_TICK_TIME + fi + # Keep the default in this process so it reaches server.properties setup. "$(dirname "$0")/start-autopause" elif isTrue "${ENABLE_AUTOSTOP}"; then "$(dirname "$0")/start-autostop"