From 961073ec96bfbb920f9afd952052c20b3791eb4d Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期二, 15 二月 2022 10:45:04 +0800 Subject: [PATCH] update 优化 TreeBuildUtils 工具 使用反射自动获取顶级父id --- script/bin/ry.bat | 72 ++++++++++++++++++------------------ 1 files changed, 36 insertions(+), 36 deletions(-) diff --git a/script/bin/ry.bat b/script/bin/ry.bat index fd33a72..28fb553 100644 --- a/script/bin/ry.bat +++ b/script/bin/ry.bat @@ -8,32 +8,32 @@ ECHO. - ECHO. [1] 锟斤拷锟斤拷%AppName% - ECHO. [2] 锟截憋拷%AppName% - ECHO. [3] 锟斤拷锟斤拷%AppName% - ECHO. [4] 锟斤拷锟斤拷状态 %AppName% - ECHO. [5] 锟斤拷 锟斤拷 + ECHO. [1] 锟斤拷锟斤拷%AppName% + ECHO. [2] 锟截憋拷%AppName% + ECHO. [3] 锟斤拷锟斤拷%AppName% + ECHO. [4] 锟斤拷锟斤拷状态 %AppName% + ECHO. [5] 锟斤拷 锟斤拷 ECHO. ECHO.锟斤拷锟斤拷锟斤拷选锟斤拷锟斤拷目锟斤拷锟斤拷锟�: set /p ID= - IF "%id%"=="1" GOTO start - IF "%id%"=="2" GOTO stop - IF "%id%"=="3" GOTO restart - IF "%id%"=="4" GOTO status - IF "%id%"=="5" EXIT + IF "%id%"=="1" GOTO start + IF "%id%"=="2" GOTO stop + IF "%id%"=="3" GOTO restart + IF "%id%"=="4" GOTO status + IF "%id%"=="5" EXIT PAUSE :start for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if defined pid ( - echo %%is running - PAUSE - ) + set pid=%%a + set image_name=%%b + ) + if defined pid ( + echo %%is running + PAUSE + ) -start javaw %JAVA_OPTS% -jar %AppName% +start javaw %JVM_OPTS% -jar %AppName% echo starting锟斤拷锟斤拷 echo Start %AppName% success... @@ -41,27 +41,27 @@ rem 锟斤拷锟斤拷stop通锟斤拷jps锟斤拷锟斤拷锟斤拷锟絧id锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 :stop - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if not defined pid (echo process %AppName% does not exists) else ( - echo prepare to kill %image_name% - echo start kill %pid% ... - rem 锟斤拷锟捷斤拷锟斤拷ID锟斤拷kill锟斤拷锟斤拷 - taskkill /f /pid %pid% - ) + for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( + set pid=%%a + set image_name=%%b + ) + if not defined pid (echo process %AppName% does not exists) else ( + echo prepare to kill %image_name% + echo start kill %pid% ... + rem 锟斤拷锟捷斤拷锟斤拷ID锟斤拷kill锟斤拷锟斤拷 + taskkill /f /pid %pid% + ) goto:eof :restart - call :stop + call :stop call :start goto:eof :status - for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( - set pid=%%a - set image_name=%%b - ) - if not defined pid (echo process %AppName% is dead ) else ( - echo %image_name% is running - ) + for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do ( + set pid=%%a + set image_name=%%b + ) + if not defined pid (echo process %AppName% is dead ) else ( + echo %image_name% is running + ) goto:eof -- Gitblit v1.9.3