-
Posts
2032 -
Joined
-
Last visited
-
Days Won
71 -
Donations
0.00 GBP
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use
Realmd & Mangosd daemons auto-restarter
in Linux
Posted
Just wrap the .exe is a bat file. You can use most bat files that restart game servers and just adapt the code to what you need.
In our case we are using this. Keep in mind what we use runs on the desktop though so not as a service, if that's what you want I'm not sure as I dont usually use services for this as i like to see the console.
::=======================:: :: Server Guardian :: ::=======================:: ::=======================:: :: SET YOUR VARIABLES! :: ::=======================:: ::=======================:: :: Window and Log name :: :: Replace "My Server" :: ::=======================:: set servername=M0 COSMIC RAY ::=======================:: :: Your start command :: :: Replace after = :: ::=======================:: set runcmd=mangosd.exe -c mangosd.conf -a ahbot.conf ::=======================:: :: End of variables :: ::=======================:: :: This will keep the window clean and easy to read @ECHO off :: Sets the title of the window title Guardian Script %servername% :: Clears the window incase there is anything there CLS :: Prints to the window what we are doing ECHO Server Guardian has been started! ECHO. ECHO ************************************************************************* ECHO To close the server, close this window and type exit in the server window ECHO ************************************************************************* ECHO. ECHO. ECHO %servername% is now starting... >> "logs\restart\%servername%.log" ECHO. >> "logs\restart\%servername%.log" ECHO. >> "logs\restart\%servername%.log" ECHO (%date%)(%time%) Server Guardian has been started! >> "logs\restart\%servername%.log" ECHO (%date%)(%time%) %servername% is now starting... :: This is a return point in case the server crashes or is closed :restart ECHO. ECHO (%date%)(%time%) %servername% is now ONLINE ECHO Watching %servername% for crashes... >> "logs\restart\%servername%.log" ECHO. >> "logs\restart\%servername%.log" ECHO (%date%)(%time%) %servername% is now ONLINE >> "logs\restart\%servername%.log" ECHO (%date%)(%time%) Watching %servername% for crashes... ::Start the actual server %runcmd% ECHO. ECHO (%date%)(%time%) Crash or Close detected! ECHO %servername% is now restarting... >> "logs\restart\%servername%.log" ECHO. >> "logs\restart\%servername%.log" ECHO (%date%)(%time%) Crash or Close detected! >> "logs\restart\%servername%.log" ECHO (%date%)(%time%) %servername% is now restarting... ::Server crashed or closed, so we point it to the return point to start the server again goto restart