|
@@ -1,12 +1,12 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
# 获取运行 simulation-oauth-server-1.0.jar 的 Java 进程的 PID
|
|
|
-PID=$(ps -ef | grep simulation-oauth-server-1.0.jar | grep java | awk '{ print $2 }')
|
|
|
+PID=$(pgrep -f simulation-gateway-1.0.jar)
|
|
|
|
|
|
# 检查是否找到了 PID
|
|
|
if [ -z "$PID" ]; then
|
|
|
- echo "Application is already stopped or not found"
|
|
|
+ echo "------- 服务已停止,无需重复执行脚本 -------"
|
|
|
else
|
|
|
- echo "Killing process with PID: $PID"
|
|
|
- kill $PID
|
|
|
+ echo "------- 杀死指定进程: $PID -------"
|
|
|
+ kill "$PID"
|
|
|
fi
|