[script]feature:support win bat service (#65)

* [script]feature:support win bat service

* add sponsor
This commit is contained in:
tomsun28
2022-04-04 20:55:09 +08:00
committed by GitHub
parent 95c36fd9a3
commit e99dd2e870
3 changed files with 82 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
@title HertzBeat
@echo off
setlocal enabledelayedexpansion
rem 项目名称
set SERVER_NAME="${project.artifactId}"
rem 应用的端口号
set SERVER_PORT=1157
echo Start shutdown HertzBeat %SERVER_NAME%
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
echo Shutdown HertzBeat %SERVER_NAME% Success!
goto q
)
echo Faild shutdown HertzBeat %SERVER_NAME%
:q
pause