Advertisement
sasaa86

server startup

Apr 23rd, 2019
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.42 KB | None | 0 0
  1. :: https://pastebin.com/atBKLxja
  2.  
  3. @echo off
  4. TITLE DayZ SA Server - Status
  5. COLOR 0A
  6. :: Variables::
  7. ::DayZServer_64.exe path.
  8. set DAYZ-SA_SERVER_LOCATION="DayZ"
  9. ::Bec.exe path.
  10. set BEC_LOCATION="Dayz\ServerProfiles\BattlEye\Bec"
  11. ::ModServer.bat path.
  12. set MOD_SERVER_LOCATION="Dayz"
  13. ::::::::::::::
  14.  
  15. echo Cashew
  16. goto startmodserver
  17. pause
  18.  
  19. :startmodserver
  20. cd "%MOD_SERVER_LOCATION%"
  21. start DZSALModServer.bat
  22. goto checkbec
  23.  
  24. ::This Will check if your server is running on start.
  25. :checksv
  26. tasklist /FI "IMAGENAME eq DayZServer_x64.exe" 2>NUL | find /I /N "DayZServer_x64.exe">NUL
  27. if "%ERRORLEVEL%"=="0" goto checkbec
  28. cls
  29. echo Server is not running, taking care of it..
  30. goto killsv
  31.  
  32. ::This will check if your Bec is running.
  33. :checkbec
  34. tasklist /FI "IMAGENAME eq Bec.exe" 2>NUL | find /I /N "Bec.exe">NUL
  35. if "%ERRORLEVEL%"=="0" goto loopsv
  36. cls
  37. echo Bec is not running, taking care of it..
  38. goto startbec
  39.  
  40. ::This will check every 30 second if your server is still running.
  41. :loopsv
  42. FOR /L %%s IN (30,-1,0) DO (
  43.     cls
  44.     echo Server is running. Checking again in %%s seconds..
  45.     timeout 1 >nul
  46. )
  47. goto checksv
  48.  
  49. ::This will shutdown your Server and Bec When this task is asked.
  50. :killsv
  51. taskkill /f /im Bec.exe
  52. taskkill /f /im DayZServer_x64.exe
  53. goto startmodserver
  54. )
  55. goto startbec
  56.  
  57. ::This will start your Bec and open up the console
  58. :startbec
  59. cd "%BEC_LOCATION%"
  60. start Bec.exe -f BEServer_x64.cfg --dsc
  61. goto checksv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement