fix: 修复kill_main.sh脚本中的变量名错误以正确查找进程

This commit is contained in:
晓丰 2025-06-10 21:28:03 +08:00
parent 44965351e9
commit 1c482f2b1a

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
# -------- 可按需修改 --------
TARGET="/opt/ql/DailyMotion/main.py" # 关键字:精确到脚本路径即可
SIG="9" # 信号;默认 -9想温和一点改成 15
@ -8,12 +7,12 @@ SIG="9" # 信号;默认 -9想温和一点改
pids=$(pgrep -f "$TARGET")
if [ -z "$all" ]; then
if [ -z "$pids" ]; then
echo "没有发现正在运行的 $TARGET"
exit 0
fi
echo "即将发送 SIG${SIG:-15} 到进程: $all"
kill "-${SIG}" $all
echo "即将发送 SIG${SIG:-15} 到进程: $pids"
kill "-${SIG:-15}" $pids
echo "完成"