diff --git a/files/autostop/stop.sh b/files/autostop/stop.sh index 2629e2fa975..7a559f6baee 100755 --- a/files/autostop/stop.sh +++ b/files/autostop/stop.sh @@ -6,4 +6,8 @@ if isTrue "${DEBUG_AUTOSTOP}"; then fi logAutostopAction "Stopping Java process" -kill -SIGTERM 1 +if isTrue "${AUTOSTOP_PKILL_USE_SUDO:-false}"; then + sudo pkill -f --signal SIGTERM mc-server-runner +else + pkill -f --signal SIGTERM mc-server-runner +fi