jw项目windows环境软件安装
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
949 B

1 year ago
1 year ago
1 year ago
  1. @echo off
  2. set port=8089
  3. netstat -ano | findstr ":%8089%" >nul
  4. if "%errorlevel%"=="0" (
  5. goto restart
  6. ) else (
  7. timeout /t 5 >nul
  8. goto start
  9. )
  10. :restart
  11. for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%8089%"') do (
  12. echo kill the process %%m who use the port
  13. taskkill /pid %%m -t -f
  14. goto start
  15. )
  16. :start
  17. cd /d d:\asb\
  18. set MYSQL_PORT=3306
  19. :loop
  20. netstat -ano | findstr ":%MYSQL_PORT%" >nul
  21. if "%errorlevel%"=="0" (
  22. goto check_es
  23. ) else (
  24. timeout /t 5 >nul
  25. goto loop
  26. )
  27. set ES_PORT=9200
  28. :check_es
  29. netstat -ano | findstr ":%ES_PORT%" >nul
  30. if "%errorlevel%"=="0" (
  31. goto check_redis
  32. ) else (
  33. timeout /t 5 >nul
  34. goto check_es
  35. )
  36. :check_redis
  37. set REDIS_PORT=9200
  38. netstat -ano | findstr ":%REDIS_PORT%" >nul
  39. if "%errorlevel%"=="0" (
  40. goto start_jar
  41. ) else (
  42. timeout /t 5 >nul
  43. goto check_redis
  44. )
  45. :start_jar
  46. start "app" javaw -javaagent:server.jar -jar server.jar --spring.profiles.active=prod