Advertisement
sasaa86

server startup alternative

Apr 23rd, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.33 KB | None | 0 0
  1.  @echo off
  2.  
  3. TITLE DayZ SA Server - Status
  4. COLOR 0A
  5.  
  6. :: Variables::
  7.  ::DayZServer_64.exe path
  8.   set DAYZ-SA_SERVER_LOCATION="Dayz"
  9.  
  10.   ::Bec.exe path
  11.   set BEC_LOCATION="Dayz\battleye\Bec"
  12.  
  13. goto checksv
  14.  
  15. :checksv
  16.   tasklist /FI "IMAGENAME eq DZSALModServer.exe" 2>NUL | find /I /N "DZSALModServer.exe">NUL
  17.   if "%ERRORLEVEL%"=="0" goto checkbec
  18.   cls
  19.   echo Server is not running, taking care of it..
  20.   goto killsv
  21.  
  22. :checkbec
  23.   tasklist /FI "IMAGENAME eq Bec.exe" 2>NUL | find /I /N "Bec.exe">NUL
  24.   if "%ERRORLEVEL%"=="0" goto loopsv
  25.   cls
  26.   echo Bec is not running, taking care of it..
  27.   goto startbec
  28.  
  29. :loopsv
  30.   FOR /L %%s IN (30,-1,0) DO (
  31.       cls
  32.       echo Server is running. Checking again in %%s seconds..
  33.       timeout 1 >nul
  34.   )
  35.   goto checksv
  36.  
  37. :killsv
  38.   taskkill /f /im Bec.exe
  39.   taskkill /f /im DZSALModServer.exe
  40.   goto startsv
  41.  
  42. :startsv
  43.   cd "%DAYZ-SA_SERVER_LOCATION%"
  44.   start DZSALModServer.exe -scrAllowFileWrite -config=serverDZ.cfg -port=2302 "-profiles=ServerProfiles" -dologs -adminlog -freezecheck -cpuCount=8 "-mod="
  45.   FOR /L %%s IN (45,-1,0) DO (
  46.       cls
  47.       echo Initializing server, wait %%s seconds to initialize Bec..
  48.       timeout 1 >nul
  49.   )
  50.   cd ..
  51.   goto startbec
  52.  
  53. :startbec
  54.   cls
  55.   cd "%BEC_LOCATION%"
  56.   start /min Bec.exe -f Config.cfg --dsc
  57.   cd ../../..
  58.   goto checksv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement