Thread: [Solved] [CS:GO]Autorestart on crash
View Single Post
ambn
Veteran Member
Join Date: Feb 2015
Location: Fun servers
Old 08-20-2017 , 02:24   Re: [CS:GO]Autorestart on crash
Reply With Quote #3

Quote:
Originally Posted by Ghost34 View Post
Does someone know a program/script that restarts the server after crash?
if your are on linux then it restarts by default on crash but you can try adding -autoupdate as well,
on windows you cannot do it without an outter script that wait for your server to crash then restarts it,

so for windows you may first disable Windows Stop working dialog. after that you need a command-line script which do the restart for you:
Code:
@echo off
goto reload
:reload
cd /d "CSGOSERVER_DIR (where srcds.exe is located)"
echo Starting Server ...
start /wait srcds.exe  -console -game csgo -usercon -ip "IPADDRESS" -port PORT +game_type 0 +game_mode 1 +mapgroup MAPGROUP_NAME +map MAPNAME +hostname "HOSTNAME"
echo Server Has Crashed %time% >> log.txt
echo =================================== >> log.txt
echo restarting server in 5 seconds.
echo restarting server in 5 seconds. >> log.txt
timeout 5
goto reload
save it as run.bat then you're done.
__________________

Last edited by ambn; 08-20-2017 at 02:26.
ambn is offline