This commit is contained in:
acgist
2022-11-09 08:28:37 +08:00
parent 44fa239d89
commit ec9a0ff37a
24 changed files with 1014 additions and 61 deletions

24
docs/bin/stop.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# 结束任务
killIndex=0
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
if [ ! -z "$processId" ]; then
echo "关闭应用:${project.artifactId}-${project.version} - $processId"
while [ ! -z "$processId" ]
do
echo -n "."
if [ $killIndex -le 0 ]; then
# 优雅关机
kill -15 $processId
elif [ $killIndex -ge 10 ]; then
echo -n '强制关闭'
# 强制关机
kill -9 $processId
fi
sleep 1
killIndex=$((killIndex+1))
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
done
echo ""
fi