Epoch_Server/Server/restartserver_x64.bat
2020-02-18 08:38:52 -07:00

39 lines
1.6 KiB
Batchfile

@echo off
:: Turn off all firewall rules
echo Disabling firewall rules for this server
netsh advfirewall firewall delete rule name="a3Epoch" program="F:\GameServers\Arma3\arma3epoch\Epochserver_x64.exe"
timeout 2
:: MAKE SURE ALL TASKS ARE REALLY STOPPED
echo Making sure all instances of this server have stopped
taskkill /f /fi "status eq not responding" /im Epochserver_x64.exe
taskkill /f /im Epochserver_x64.exe
timeout 2
:: Rotate Logs and backup DB
echo Rotating logs and backing up DB
start "" "F:\GameServers\Arma3\arma3epoch\Tools\log-rotator.cmd"
timeout 2
:: RESTARTING THE ARMA 3 SERVER BE SURE TO EDIT THIS TO YOUR SERVER .EXE LOCATION -NOTE ALSO THIS IS WHERE YOU DEFINE WHERE YOU CONFIG.CFG IS
echo Starting ARMA 3 Server...
C:\Windows\System32\cmd.exe /C start "arma3" "F:\GameServers\Arma3\arma3epoch\Epochserver_x64.exe" "-mod=@Epoch;@bornholm;@CBA_A3;" "-serverMod=@EpochHive;" -config=F:\GameServers\Arma3\arma3epoch\sc\server.cfg -port=2302 -profiles=sc -cfg=F:\GameServers\Arma3\arma3epoch\sc\basic.cfg -name=sc -autoINIT -Loadmissiontomemory
echo ARMA 3 Server has started
timeout 60
:: THIS RUNS THE SERVER MONITOR FOR YOU SO YOU DON'T FORGET
echo Starting Server Monitor Loop
set ServerMonitorPath="C:\Epochserver"
cd /d %ServerMonitorPath%
start /min "" "servermonitor.bat"
echo Server Monitor has started. Have Fun
timeout 5
:: Turn On Firewall rule
timeout 10
echo Turning on Firewall Rule to allow server network traffic
netsh advfirewall firewall add rule name="a3Epoch" dir=in action=allow program="F:\GameServers\Arma3\arma3epoch\Epochserver_x64.exe" enable=yes
echo Firewall is on and players can join
timeout 5
@exit