stop.sh 323 B

123456789101112
  1. #!/bin/bash
  2. # 获取运行 simulation-oauth-server-1.0.jar 的 Java 进程的 PID
  3. PID=$(pgrep -f simulation-gateway-1.0.jar)
  4. # 检查是否找到了 PID
  5. if [ -z "$PID" ]; then
  6. echo "------- 服务已停止,无需重复执行脚本 -------"
  7. else
  8. echo "------- 杀死指定进程: $PID -------"
  9. kill "$PID"
  10. fi