mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-20 05:15:42 +00:00
add watchdog scripts
This commit is contained in:
parent
a512fcbf45
commit
d4220bd70d
3
.gitignore
vendored
3
.gitignore
vendored
@ -8,8 +8,11 @@
|
||||
!/.gitattributes
|
||||
|
||||
!/z_server.bat
|
||||
!/z_server_watchdog.bat
|
||||
!/z_server_pvbrust.bat
|
||||
!/z_server_pvbrust_watchdog.bat
|
||||
!/z_server_pvbvote.bat
|
||||
!/z_server_pvbvote_watchdog.bat
|
||||
|
||||
# Folder to not ignore
|
||||
!/userraw
|
||||
|
30
z_server_pvbrust_watchdog.bat
Normal file
30
z_server_pvbrust_watchdog.bat
Normal file
@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
::Name of the server's title
|
||||
set name=IW4x Bot Warfare Server
|
||||
::Only change this when you don't want to keep the bat files in the game folder. MOST WON'T NEED TO EDIT THIS!
|
||||
set gamepath=%cd%
|
||||
::Rate to check if server is hung
|
||||
set check_rate=300
|
||||
::Server log location
|
||||
set log_path=%gamepath%\userraw\logs
|
||||
set log_file=console_mp.log
|
||||
|
||||
title IW4x MP - %name% - Server watchdog
|
||||
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
|
||||
echo (%date%) - (%time%) %name% server watchdog start.
|
||||
|
||||
::https://superuser.com/questions/699769/batch-file-last-modification-time-with-seconds
|
||||
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
|
||||
|
||||
:Server
|
||||
set modif_time=%modif_time_temp%
|
||||
|
||||
timeout /t %check_rate% /nobreak > nul
|
||||
|
||||
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
|
||||
|
||||
if "%modif_time_temp%" == "%modif_time%" (
|
||||
echo "(%date%) - (%time%) WARNING: %name% server hung, killing server..."
|
||||
taskkill /FI "WINDOWTITLE eq %name%" /F
|
||||
)
|
||||
goto Server
|
30
z_server_pvbvote_watchdog.bat
Normal file
30
z_server_pvbvote_watchdog.bat
Normal file
@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
::Name of the server's title
|
||||
set name=IW4x Bot Warfare Server
|
||||
::Only change this when you don't want to keep the bat files in the game folder. MOST WON'T NEED TO EDIT THIS!
|
||||
set gamepath=%cd%
|
||||
::Rate to check if server is hung
|
||||
set check_rate=300
|
||||
::Server log location
|
||||
set log_path=%gamepath%\userraw\logs
|
||||
set log_file=console_mp.log
|
||||
|
||||
title IW4x MP - %name% - Server watchdog
|
||||
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
|
||||
echo (%date%) - (%time%) %name% server watchdog start.
|
||||
|
||||
::https://superuser.com/questions/699769/batch-file-last-modification-time-with-seconds
|
||||
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
|
||||
|
||||
:Server
|
||||
set modif_time=%modif_time_temp%
|
||||
|
||||
timeout /t %check_rate% /nobreak > nul
|
||||
|
||||
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
|
||||
|
||||
if "%modif_time_temp%" == "%modif_time%" (
|
||||
echo "(%date%) - (%time%) WARNING: %name% server hung, killing server..."
|
||||
taskkill /FI "WINDOWTITLE eq %name%" /F
|
||||
)
|
||||
goto Server
|
30
z_server_watchdog.bat
Normal file
30
z_server_watchdog.bat
Normal file
@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
::Name of the server's title
|
||||
set name=IW4x Bot Warfare Server
|
||||
::Only change this when you don't want to keep the bat files in the game folder. MOST WON'T NEED TO EDIT THIS!
|
||||
set gamepath=%cd%
|
||||
::Rate to check if server is hung
|
||||
set check_rate=300
|
||||
::Server log location
|
||||
set log_path=%gamepath%\userraw\logs
|
||||
set log_file=console_mp.log
|
||||
|
||||
title IW4x MP - %name% - Server watchdog
|
||||
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
|
||||
echo (%date%) - (%time%) %name% server watchdog start.
|
||||
|
||||
::https://superuser.com/questions/699769/batch-file-last-modification-time-with-seconds
|
||||
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
|
||||
|
||||
:Server
|
||||
set modif_time=%modif_time_temp%
|
||||
|
||||
timeout /t %check_rate% /nobreak > nul
|
||||
|
||||
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
|
||||
|
||||
if "%modif_time_temp%" == "%modif_time%" (
|
||||
echo "(%date%) - (%time%) WARNING: %name% server hung, killing server..."
|
||||
taskkill /FI "WINDOWTITLE eq %name%" /F
|
||||
)
|
||||
goto Server
|
Loading…
x
Reference in New Issue
Block a user