crazy-max / csgo-server-launcher

Counter-Strike Global Offensive Dedicated Server Launcher
GNU Lesser General Public License v3.0
586 stars 119 forks source link

Restart after server crash. CS2 #125

Closed mrdiega closed 11 months ago

mrdiega commented 12 months ago

OS Debian 11

I adapted this launcher for cs2, all commands work properly. But for some reason, when the server crashes, restarting does not work. In theory, this code should be responsible for restarting server if it crashes, but it doesn’t work. Can anyone give a hint?

  # Start game
  PARAM_START="${PARAM_START} ${GENERATED_ARGS}"
  echo "Start command : $PARAM_START"

  if [ "$CSGO_DOCKER" = "0" ]
  then
    if [ $(id -u) -eq 0 ]
    then
      su - ${USER} -c "cd $DIR_ROOT ; rm -f screenlog.* ; screen -L -AmdS $SCREEN_NAME ./$DAEMON_GAME $PARAM_START"
    else
      cd "$DIR_ROOT"
      rm -f screenlog.*
      screen -L -AmdS ${SCREEN_NAME} ./${DAEMON_GAME} ${PARAM_START}
    fi
  else
    cd ${DIR_ROOT}
    bash ${DAEMON_GAME} ${PARAM_START}
  fi

https://github.com/crazy-max/csgo-server-launcher/blob/28be92206cad1a9d85791aa8064f8e51ecb41fa4/csgo-server-launcher.sh#L89 To start server I use ./cs2-server-launcher.sh start