aboutsummarylogtreecommitdiffstats
path: root/papermc.sh
diff options
context:
space:
mode:
authorGordian Edenhofer2021-08-28 19:12:54 +0200
committerGordian Edenhofer2021-08-28 19:12:54 +0200
commit0bd53f87c9941bc2d1fd209e72f262221dff1ef6 (patch)
tree47084f275db6b9e5afdbdd3b86874440e0dd0e9d /papermc.sh
parentad447e0980225c70a33a2165c37b572d7e97072d (diff)
downloadaur-0bd53f87c9941bc2d1fd209e72f262221dff1ef6.tar.gz
upgpkg: minecraft-server 1.17.1-2
Do not lock the minecraft server session if an administrator is connected to the console. Instead, re-introduce the admin check in the idle-server daemon to verify whether it is safe to shut down the server. Resolves #12. upgpkg: cuberite 1.12.2c0_094cd61-3 upgpkg: cuberite-bin 1.12.2b258-3 upgpkg: papermc 1.17.1+b100-3 upgpkg: spigot 1.17.1+b131-3
Diffstat (limited to 'papermc.sh')
-rwxr-xr-xpapermc.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/papermc.sh b/papermc.sh
index cfc90446ac2d..4edfeec09aa4 100755
--- a/papermc.sh
+++ b/papermc.sh
@@ -122,7 +122,10 @@ idle_server_daemon() {
if socket_has_session "${SESSION_NAME}"; then
# Game server is up and running
# Check for active player
- if SUDO_CMD="" is_player_online; then
+ if [[ -n "$(tmux -L "${SESSION_NAME}" list-clients -t "${SESSION_NAME}":0.0 2> /dev/null)" ]]; then
+ # An administrator is connected to the console, pause player checking
+ echo "An admin is connected to the console. Pause player checking."
+ elif SUDO_CMD="" is_player_online; then
# No player was seen on the server through list
no_player=$(( no_player + CHECK_PLAYER_TIME ))
# Stop the game server if no player was active for at least ${IDLE_IF_TIME}
@@ -417,9 +420,7 @@ server_command() {
# Enter the tmux game session
server_console() {
if socket_has_session "${SESSION_NAME}"; then
- ${SUDO_CMD} tmux -L "${SESSION_NAME}" wait-for -L "command_lock"
${SUDO_CMD} tmux -L "${SESSION_NAME}" attach -t "${SESSION_NAME}":0.0
- ${SUDO_CMD} tmux -L "${SESSION_NAME}" wait-for -U "command_lock"
else
echo "There is no ${SESSION_NAME} session to connect to."
fi