#!/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 if [ -z "$PID" ]; then echo "Application is already stopped or not found" else echo "Killing process with PID: $PID" kill $PID fi