#!/bin/bash PID=$(pgrep -f "node src/index.js") if [ -z "$PID" ]; then echo "服务未运行" exit 1 fi echo "停止服务 (PID: $PID)..." kill $PID echo "服务已停止"