#!/bin/bash
# 停止伊朗电厂袭击监控

LOG_FILE="/root/.openclaw/workspace/logs/iran-monitor.log"

echo "[$(date '+%Y-%m-%d %H:%M:%S')] 停止伊朗电厂袭击监控任务" >> "$LOG_FILE"

# 从 crontab 中移除监控任务
crontab -l 2>/dev/null | grep -v "monitor-iran-attack" > /tmp/cron_tmp
crontab /tmp/cron_tmp

echo "[$(date '+%Y-%m-%d %H:%M:%S')] 监控任务已停止" >> "$LOG_FILE"

# 发送通知
openclaw message send \
    --channel telegram \
    --target "6785724728" \
    --message "📋 监控任务已完成

✅ 伊朗电厂袭击监控已停止
⏰ 监控时长：约 16 小时
📊 日志位置：/root/.openclaw/workspace/logs/iran-monitor.log

如有需要可随时重新启动监控。" \
    2>&1
