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

Commit

Permalink
server-common.sh: Fix healthcheck for CS2
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Reichl <thetredev@gmail.com>
  • Loading branch information
thetredev committed Dec 21, 2023
1 parent 5ebb462 commit b22819a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion image/base/usr/local/lib/steamcmd/server-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}


Expand Down

0 comments on commit b22819a

Please sign in to comment.