From b22819ab9ffd2fef53c2c960af15fc40bcd4a9ea Mon Sep 17 00:00:00 2001 From: Timo Reichl Date: Fri, 22 Dec 2023 00:21:10 +0100 Subject: [PATCH] server-common.sh: Fix healthcheck for CS2 Signed-off-by: Timo Reichl --- image/base/usr/local/lib/steamcmd/server-common.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/image/base/usr/local/lib/steamcmd/server-common.sh b/image/base/usr/local/lib/steamcmd/server-common.sh index bb35aae..638b34e 100755 --- a/image/base/usr/local/lib/steamcmd/server-common.sh +++ b/image/base/usr/local/lib/steamcmd/server-common.sh @@ -10,6 +10,7 @@ TMUX_CMD="tmux -S ${STEAMCMD_SERVER_SESSION_SOCKET}" # Define common healthy signal SIGNAL_SERVER_HEALTHY="Connection to Steam servers successful." +SIGNAL_SERVER_HEALTHY2='\[STARTUP\] {*.*} activated session on GC' # Define common messages @@ -38,7 +39,13 @@ _is_running() { healthy() { - return $(${TMUX_CMD} capture-pane -pt ${STEAMCMD_SERVER_SESSION_NAME} | grep -w "${SIGNAL_SERVER_HEALTHY}" > /dev/null) + local captured_pane=$(${TMUX_CMD} capture-pane -pt ${STEAMCMD_SERVER_SESSION_NAME}) + + if $($(echo ${captured_pane} | grep -w "${SIGNAL_SERVER_HEALTHY}" > /dev/null)); then + return 0 + fi + + return $(echo ${captured_pane} | grep -wE "${SIGNAL_SERVER_HEALTHY2}" > /dev/null) }