加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ry.bat 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
test@test.com 提交于 2021-11-20 17:17 . .
@echo off
rem jarƽ��Ŀ¼
set AppName=identity-admin.jar
rem JVM����
set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
ECHO.
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
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
)
start javaw -jar %JAVA_OPTS% identity-admin.jar
echo starting����
echo Start %AppName% success...
goto:eof
rem ����stopͨ��jps�������pid����������
: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%
)
goto:eof
:restart
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
)
goto:eof
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化