添加停止命令

This commit is contained in:
heavyrian2012
2022-12-12 12:37:31 +08:00
parent 1c18d862a1
commit 9047020d69
2 changed files with 31 additions and 0 deletions
@@ -44,6 +44,12 @@
<fileMode>0755</fileMode>
</file>
<file>
<source>src/main/scripts/stop.sh</source>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</file>
<file>
<source>src/main/scripts/wildfirechat.bat</source>
<outputDirectory>bin</outputDirectory>
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
pid=`ps -ef | grep wildfirechat.server.Server | grep -v grep | awk '{print $2}'`
if [ -z $pid ]; then
echo "野火IM服务不存在"
exit 0
fi
kill -15 $pid
for i in {1..15}
do
pid=`ps -ef | grep wildfirechat.server.Server | grep -v grep | awk '{print $2}'`
if [ -z $pid ]; then
echo "野火IM服务已结束"
exit 0
else
echo "正在结束中,请等待..."
sleep 1
fi
done
echo "正常结束失败,强制结束!"
kill -9 $pid