How to make a server auto restart

is there any way someone could write the batch file for me.. my server is installed on C:\ArmA 2 Server and i installed BEC to C:\ServerTools

and the file that starts my server has these commands

@echo off
echo Starting MySQL database. Please wait 5-10 seconds.
start /MIN /D.\MySQL\ MySQL.bat
ping 127.0.0.1 -n 15 >NUL
.\MySQL\cecho {0A} OK.{07}
echo.
echo.
echo.
echo Executing spawn script...
.\MySQL\bin\mysql --user=root --password=root --host=127.0.0.1 --port=3316 --database=hivemind --execute="call pMain()"
ping 127.0.0.1 -n 5 >NUL
.\MySQL\cecho {0A} OK.{07}
echo.
echo.
echo.
echo Starting server...
start .\Expansion\beta\arma2oaserver.exe -mod=@dayz;@hive -name=cfgdayz -config=cfgdayz\server.cfg -cfg=cfgdayz\arma2.cfg -profiles=cfgdayz -world=Chernarus -exThreads=0 -maxMem=2024
.\MySQL\cecho {0A} OK.{07}
echo.
echo.
echo.
echo.
echo.
echo.
.\MySQL\cecho {0B}Launcher created by Pwnoz0r.{07}
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo.
.\MySQL\cecho {0A}Leaving le launcher...{07}
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo.
echo.
exit
 
@echo off
echo Starting MySQL database. Please wait 5-10 seconds.
start /MIN /D.\MySQL\ MySQL.bat
ping 127.0.0.1 -n 15 >NUL
.\MySQL\cecho {0A} OK.{07}
echo.
echo.
echo.
echo Executing spawn script...
.\MySQL\bin\mysql --user=root --password=root --host=127.0.0.1 --port=3316 --database=hivemind --execute="call pMain()"
ping 127.0.0.1 -n 5 >NUL
.\MySQL\cecho {0A} OK.{07}
echo.
echo.
echo Starting BEC
start C:\ServerTools\dayzbec.bat
echo.
echo Starting server...
start .\Expansion\beta\arma2oaserver.exe -mod=@dayz;@hive -name=cfgdayz -config=cfgdayz\server.cfg -cfg=cfgdayz\arma2.cfg -profiles=cfgdayz -world=Chernarus -exThreads=0 -maxMem=2024
.\MySQL\cecho {0A} OK.{07}
echo.
echo.
echo.
echo.
echo.
echo.
.\MySQL\cecho {0B}Launcher created by Pwnoz0r.{07}
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo.
.\MySQL\cecho {0A}Leaving le launcher...{07}
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo.
echo.
exit
 
the bepath i was using was for arma battleeye, didnt know there was one in dayzcfg folder also..

How will i know if i set a auto restart correctly, wait until it pops up
 
Code:
@echo off
color 0a
title Server Starter
:top
echo Executing pMain()
.\MySQL\bin\mysql --user=root --password=root --host=127.0.0.1 --port=3316 --database=hivemind --execute="call pMain()"
ping 127.0.0.1 -n 5 >NUL
echo Complete!
ping 127.0.0.1 -n 1 >NUL
cls
 
echo Launching And Watching Server
start /wait .\Expansion\beta\arma2oaserver.exe -mod=@dayz;@hive -name=cfgdayz -config=cfgdayz\server.cfg -cfg=cfgdayz\arma2.cfg -profiles=cfgdayz -world=Chernarus -exThreads=0 -maxMem=1024
ping 127.0.0.1 -n 5 >NUL
echo Server has exited ... Restarting!
ping 127.0.0.1 -n 1 >NUL
cls
goto top

Paste all of that into a batch file (filename.bat) using notepad and save the batch file in your server root (should be in same directory as @START_SERVER.bat).

After you've done that, just double click the batch file and it will start your server and restart it if it crashes. If you want to shut your server down with out it restarting, exit the batch file.


How can I combine that with Pwnoz0r's @START-SERVER.bat?

Code:
@echo off
echo Starting MySQL database. Please wait 5-10 seconds.
start /MIN /D.\MySQL\ MySQL.bat
ping 127.0.0.1 -n 15 >NUL
.\MySQL\cecho {0A}OK.{07}
echo.
echo.
echo.
echo Executing spawn script...
.\MySQL\bin\mysql --user=root --password=root --host=127.0.0.1 --port=3316 --database=hivemind --execute="call pMain()"
ping 127.0.0.1 -n 5 >NUL
.\MySQL\cecho {0A}OK.{07}
echo.
echo.
echo.
echo Starting server...
start /REALTIME .\Expansion\beta\arma2oaserver.exe -mod=@hive;@dayz -name=cfgdayz -config=cfgdayz\server.cfg -cfg=cfgdayz\arma2.cfg -profiles=cfgdayz -world=Chernarus -cpuCount=4 -exThreads=1 -maxmem=2047 -noCB -noSound
.\MySQL\cecho {0A}OK.{07} 
echo.
echo.
echo.
echo.
echo.
echo.
.\MySQL\cecho {0B}Launcher created by Pwnoz0r.{07}
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo.
.\MySQL\cecho {0A}Leaving le launcher...{07}
ping 127.0.0.1 -n 5 >NUL
echo.
echo.
echo.
echo.
echo.
exit
 
Back
Top