Skip to content

Commit

Permalink
Add more logs when PAUSE_IF_NO_PLAYERS is used (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
0237h authored Aug 28, 2024
1 parent fa69780 commit 18cc11b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/opt/backup-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,13 @@ while true; do
if [[ ${PAUSE_IF_NO_PLAYERS^^} = TRUE ]]; then
while true; do
if is_paused; then
log INFO "Server is paused, waiting ${PLAYERS_ONLINE_CHECK_INTERVAL}..."
sleep "${PLAYERS_ONLINE_CHECK_INTERVAL}"
elif ! PLAYERS_ONLINE=$(mc-monitor status --host "${SERVER_HOST}" --port "${SERVER_PORT}" --show-player-count 2>&1); then
log ERROR "Error querying the server, waiting ${PLAYERS_ONLINE_CHECK_INTERVAL}..."
sleep "${PLAYERS_ONLINE_CHECK_INTERVAL}"
elif [ "${PLAYERS_ONLINE}" = 0 ]; then
log INFO "No players online, waiting ${PLAYERS_ONLINE_CHECK_INTERVAL}..."
sleep "${PLAYERS_ONLINE_CHECK_INTERVAL}"
else
break
Expand Down

0 comments on commit 18cc11b

Please sign in to comment.