Files
LJ360/run.sh
2025-12-19 08:56:58 +08:00

19 lines
400 B
Bash
Executable File
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.
#!/bin/bash
# 获取当前脚本的 PID
SELF_PID=$$
echo "【1/3】终止其他 run.sh跳过自身 PID=$SELF_PID..."
# 使用 pgrep + grep -v 排除自己
pgrep -f "run.sh" | grep -v "^$SELF_PID$" | xargs kill -9 2>/dev/null
echo "【2/3】终止 run_live_demo.py ..."
pkill -9 -f "run_live_demo.py" 2>/dev/null
sleep 1
echo "【3/3】启动新实例..."
exec python3 ./run_live_demo.py