Arma3_Exile_Mission/servermonitor.bat
Zepheris 230ea2b038 Initial Arma Exile setup. Current Mods: a3_dms, a3_exile_occupation, arma server monitor, marma, modified
ExileServer_system_rcon_thread_check.sqf added debug line to track server uptime and server restart countdown
2018-03-01 19:51:54 -07:00

29 lines
1.1 KiB
Batchfile

@echo off
::IMPORTANT TO NAME IT SO WE CAN KILL IT
title ServerMonitor
SET ARMA=f:\Arma3\Arma3_Server
F:
CD /d %ARMA%
:start
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server_SC.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server_SC">NUL
if "%ERRORLEVEL%"=="0" goto loop
echo Server is not running, will be started now
timeout 10
start "" %ARMA%\restartserver.bat
echo Server started succesfully
timeout 10
exit
goto started
:loop
cls
echo Server is already running, running monitoring loop
:started
::THE 80 REFERS TO SECONDS AND HOW OFTEN IT WILL CHECK,YOU CAN SET IT TO WHATEVER YOU WANT. I JUST DONT WANT MY SERVER DOWN FOR MUCH LONGER THAN THAT!
::New error fault kill, will check for err fault and clear it and hopefully restart, a little more promise but no guarantee :)
taskkill /f /im WerFault.exe /fi "WINDOWTITLE eq Arma 3"
C:\Windows\System32\timeout /t 150
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server_SC.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server_SC">NUL
if "%ERRORLEVEL%"=="0" goto loop
goto start