Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit b22819a

Browse files
committed
server-common.sh: Fix healthcheck for CS2
Signed-off-by: Timo Reichl <thetredev@gmail.com>
1 parent 5ebb462 commit b22819a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

image/base/usr/local/lib/steamcmd/server-common.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ TMUX_CMD="tmux -S ${STEAMCMD_SERVER_SESSION_SOCKET}"
1010

1111
# Define common healthy signal
1212
SIGNAL_SERVER_HEALTHY="Connection to Steam servers successful."
13+
SIGNAL_SERVER_HEALTHY2='\[STARTUP\] {*.*} activated session on GC'
1314

1415

1516
# Define common messages
@@ -38,7 +39,13 @@ _is_running() {
3839

3940

4041
healthy() {
41-
return $(${TMUX_CMD} capture-pane -pt ${STEAMCMD_SERVER_SESSION_NAME} | grep -w "${SIGNAL_SERVER_HEALTHY}" > /dev/null)
42+
local captured_pane=$(${TMUX_CMD} capture-pane -pt ${STEAMCMD_SERVER_SESSION_NAME})
43+
44+
if $($(echo ${captured_pane} | grep -w "${SIGNAL_SERVER_HEALTHY}" > /dev/null)); then
45+
return 0
46+
fi
47+
48+
return $(echo ${captured_pane} | grep -wE "${SIGNAL_SERVER_HEALTHY2}" > /dev/null)
4249
}
4350

4451

0 commit comments

Comments
 (0)