stop.sh 339 B

123456789101112
  1. #!/bin/bash
  2. # 获取运行 simulation-oauth-server-1.0.jar 的 Java 进程的 PID
  3. PID=$(ps -ef | grep simulation-oauth-server-1.0.jar | grep java | awk '{ print $2 }')
  4. # 检查是否找到了 PID
  5. if [ -z "$PID" ]; then
  6. echo "Application is already stopped or not found"
  7. else
  8. echo "Killing process with PID: $PID"
  9. kill $PID
  10. fi