• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature Windows restarter with log saving function without external programs - only bash

Svira

Active Member
Joined
Jan 27, 2008
Messages
268
Solutions
11
Reaction score
36
I saw that many people using Windows have problems with the auto restarter that monitors the tfs process, even if there is one on the forum, it does not save logs for Windows, which can be helpful in the event of various failures. Below is a restarter that starts 3 consoles:
1. Monitors the server (makes sure the process is active)
2. Server console
3. Streaming server console (sends logs to OUTPUT.LOG)

I hope it will be useful ;)

Bash:
@echo off

set SERVER_DIR=SERVER PATH sample x:/ots/tfs
set LOG_FILE=%SERVER_DIR%\output.log

:check
tasklist | find "theforgottenserver.exe" > nul
if %errorlevel% neq 0 (
    echo Server is not running. Starting the server...
    start "TFS_Server" /D "%SERVER_DIR%" cmd /c "start theforgottenserver.exe & theforgottenserver.exe > %LOG_FILE% 2>&1"
) else (
    echo Server is running.
)

timeout /t 10 /nobreak > nul
goto check
 
This is super useful for windows users! Thanks for sharing!

I do believe this is the wrong section though, as its not a c++ code.
 
he doesn't really fit in in other places, but I know he's wanted, he might be saved and useful to the community.
 
Back
Top