auto-sync: 2026-03-26 00:58:29

This commit is contained in:
cfdaily
2026-03-26 00:58:29 +08:00
parent 575f34a598
commit 8d93f44376
+13 -30
View File
@@ -1,38 +1,21 @@
#!/bin/bash #!/bin/bash
# 停止文件监控脚本 # 停止文件监控
# ============================================
PROJECT_DIR="/Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live" if [ ! -f "../watcher.pid" ]; then
PID_FILE="$PROJECT_DIR/watcher.pid" echo "✓ No PID file found, watcher not running"
if [ ! -f "$PID_FILE" ]; then
echo "File watcher is not running (no PID file found)"
exit 0 exit 0
fi fi
pid=$(cat "$PID_FILE") PID=$(cat "../watcher.pid")
if ps -p "$pid" > /dev/null 2>&1; then if kill -0 $PID 2>/dev/null; then
echo "Stopping file watcher (PID: $pid)..." echo "Stopping file watcher (PID $PID)"
kill "$pid" kill $PID
rm -f "../watcher.pid"
# 等待进程结束 echo "✓ Stopped"
for i in {1..10}; do
if ! ps -p "$pid" > /dev/null 2>&1; then
break
fi
sleep 1
done
# 强制终止如果还活着
if ps -p "$pid" > /dev/null 2>&1; then
echo "Force killing process..."
kill -9 "$pid"
fi
rm -f "$PID_FILE"
echo "File watcher stopped"
else else
echo "Process $pid not found, removing stale PID file" echo "Process $PID not running, removing PID file"
rm -f "$PID_FILE" rm -f "../watcher.pid"
fi fi