#!/bin/bash

# 检查文件监控器状态
# ============================================

if [ ! -f "../watcher.pid" ]; then
    echo "=== File Watcher Status ==="
    echo "Status: NOT RUNNING"
    echo "To start: ./management/start-watcher.sh"
    exit 0
fi

PID=$(cat "../watcher.pid")

if kill -0 $PID 2>/dev/null; then
    echo "=== File Watcher Status ==="
    echo "Status: ✅ RUNNING"
    echo "PID: $PID"
    echo "Check interval: 60 seconds (1 minute)"
    echo "Log: file-watcher.log"
    echo "Project directory: /Users/chufeng/.openclaw/sanguo_projects/sanguo_quant_live"
else
    echo "=== File Watcher Status ==="
    echo "Status: ❌ NOT RUNNING (PID file exists but process dead)"
    echo "To start: ./management/start-watcher.sh"
    rm -f "../watcher.pid"
fi
