admin.bat 767 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. @echo off
  2. setlocal & pushd
  3. set MAIN_CLASS=io.jboot.admin.Application
  4. if "%1"=="start" goto normal
  5. if "%1"=="stop" goto normal
  6. if "%1"=="restart" goto normal
  7. goto error
  8. :error
  9. echo Usage: jpress.bat {start stop restart}
  10. goto :eof
  11. :normal
  12. if "%1"=="start" goto start
  13. if "%1"=="stop" goto stop
  14. if "%1"=="restart" goto restart
  15. goto :eof
  16. :start
  17. set APP_BASE_PATH=%~dp0
  18. set CP=%APP_BASE_PATH%config;%APP_BASE_PATH%lib\*
  19. echo starting jpress application
  20. java -Xverify:none %JAVA_OPTS% -cp %CP% %MAIN_CLASS%
  21. goto :eof
  22. :stop
  23. set "PATH=%JAVA_HOME%\bin;%PATH%"
  24. echo killing jpress application
  25. for /f "tokens=1" %%i in ('jps -l ^| find "%MAIN_CLASS%"') do ( taskkill /F /PID %%i )
  26. echo Done!
  27. goto :eof
  28. :restart
  29. call :stop
  30. call :start
  31. goto :eof
  32. endlocal & popd
  33. pause