Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.87 KB | None | 0 0
  1. @if NOT "%FTB_VERBOSE%"=="yes" (
  2.     @echo off
  3. )
  4.  
  5. call settings.bat
  6.  
  7. if NOT EXIST %JARFILE% (
  8.     goto install
  9. )
  10. if NOT EXIST libraries\%LAUNCHWRAPPER% (
  11.     goto install
  12. )
  13. goto skipinstall
  14.  
  15. :install
  16. echo running install script!
  17. call FTBInstall.bat
  18. :skipinstall
  19.  
  20. REM Check if java in path
  21. REM TODO: use %JAVACMD%
  22. where java > NUL 2>&1
  23.  
  24. if %ERRORLEVEL% NEQ 0 (
  25.     echo No java binary in path. Can't run server, exiting...
  26.    pause
  27.    exit /B
  28. )
  29.  
  30. REM Test JVM
  31. REM e.g. 32-bit JVM does not have server\jvm.dll library
  32. java -server -version > java-test.log 2>&1
  33.  
  34. if %ERRORLEVEL% NEQ 0 (
  35.    echo Detected following JVM error:
  36.    echo =======================================
  37.    more java-test.log
  38.    echo =======================================
  39.    echo JVM test failed. Can't run server, Exiting...
  40.     pause
  41.     exit /B
  42. )
  43.  
  44. if not exist eula.txt (
  45.     echo Missing eula.txt. Startup will fail and eula.txt will be created
  46.     echo Make sure to read eula.txt before playing!
  47.     goto startserver
  48. )
  49.  
  50. find "eula=false" eula.txt 1 > NUL 2>&1
  51. if %ERRORLEVEL% EQU 0 (
  52.     echo Make sure to read eula.txt before playing! Exiting.
  53.     pause
  54.     exit /B
  55. )
  56.  
  57. del /f /q autostart.stamp > nul 2>1
  58.  
  59. :startserver
  60. echo Starting server
  61. java -server -Xms%MIN_RAM% -Xmx%MAX_RAM% -XX:PermSize=%PERMGEN_SIZE% %JAVA_PARAMETERS% -jar %FORGEJAR% nogui
  62.  
  63. :server_loop
  64. if exist autostart.stamp (
  65.     del /f /q autostart.stamp > nul 2>1
  66.     echo If you want to completely stop the server process now, press Ctrl+C before the time is up!
  67.     for /l %%i in (5,-1,1) do (
  68.         echo Restarting server in %%i
  69.         choice /t 1 /d y > nul
  70.     )
  71.     echo Starting server now
  72.     java -server -Xms%MIN_RAM% -Xmx%MAX_RAM% -XX:PermSize=%PERMGEN_SIZE% %JAVA_PARAMETERS% -jar %FORGEJAR% nogui
  73.     echo Server process finished
  74.     goto :server_loop
  75. )
  76. echo Exiting...
  77. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement