DailyMotion/kill_main.sh

20 lines
460 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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