🔄 Reboot Checker — 检测意外重启
v1.0.0检测意外系统重启并在系统恢复在线时发出警报。跟踪启动历史并标记可疑的重启,用于安全监控场景。
0· 76·0 当前·0 累计
安全扫描
OpenClaw
安全
high confidence该技能内部一致:一个小型的本地 Bash 脚本,用于将启动时间记录到状态/历史文件并在重启时报告;它不请求凭据或网络访问,其行为与其描述相符。
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv1.0.02026/3/29
初始版本 — 检测意外系统重启
● 无害
安装命令
点击复制官方npx clawhub@latest install reboot-checker
🇨🇳 镜像加速npx clawhub@latest install reboot-checker --registry https://cn.longxiaskill.com
技能文档
检测意外重启并跟踪启动历史。用于安全监控 — 在系统意外重启时发出警报。
Quick Start
# Check for unexpected reboot (run at startup or on first heartbeat)
bash {baseDir}/scripts/check-reboot.sh# View boot history
bash {baseDir}/scripts/check-reboot.sh --history
# Reset state (mark current boot as known)
bash {baseDir}/scripts/check-reboot.sh --reset
How It Works
- 首次运行时,将当前启动时间记录到状态文件
- 后续运行时,将当前启动时间与上次已知时间进行比较
- 如果启动时间意外更改 → 发出警报
- 状态文件:
~/.reboot-check-state(可使用--state自定义)
Output
STATUS: CLEAN — No reboot since last check
STATUS: REBOOTED — System rebooted since last check
STATUS: FIRST_RUN — First time running, recording boot time
Integration
Use with cron or heartbeat systems:
# Cron: check every hour
0 /path/to/check-reboot.sh >> /var/log/reboot-check.log# Or in a heartbeat script
RESULT=$(bash check-reboot.sh)
[[ "$RESULT" == "REBOOTED" ]] && echo "ALERT: Unexpected reboot!"
Options
--state FILE— State file path (default:~/.reboot-check-state)--history— Show recorded boot history--reset— Reset state to current boot--json— Output as JSON
数据来源:ClawHub ↗ · 中文优化:龙虾技能库