A simple batch file to ensure a BeamMP server instantly restarts if it crashes or the server window is manually closed (i.e. after configuration changes, or new mods are added to ...\Resources\Client\
, etc., for fast restarts).
An error handler.
- Prints usage info about itself.
- Does a panic condition check to make sure
BeamMP-Server.exe
is present to prevent command window spam in the event that it is not found. - Launches
BeamMP-Server.exe
and waits for it to crash or be manually closed. - If the server crashes or is manually closed, logs timestamped notification of crash or close in the command window, and instantly restarts
BeamMP-Server.exe
.
- Place
BeamMP-Server-Watchdog.bat
next toBeamMP-Server.exe
. - (OPTIONAL) Create shortcut to
BeamMP-Server-Watchdog.bat
on desktop. - Launch the server via the shortcut.
- To fully exit, first close the batch file command window, and then close the server.