Rename to hkt.sh

This commit is contained in:
mango
2026-03-21 01:10:53 +08:00
parent 76a263d0f9
commit 8f1171fe99
6676 changed files with 1724268 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#!/data/data/com.termux/files/usr/bin/bash
# OpenClaw 守护进程 - 自动重启
while true; do
# 检查 OpenClaw 是否在运行
if ! proot-distro login ubuntu -- bash -c 'pgrep -f openclaw' > /dev/null 2>&1; then
echo "[$(date)] OpenClaw 已停止,正在重启..."
# 清理旧进程
pkill -9 openclaw 2>/dev/null
pkill -9 node 2>/dev/null
# 启动 OpenClaw
proot-distro login ubuntu -- bash -c '
export NODE_OPTIONS="-r /root/hijack.js"
cd /root
nohup openclaw gateway --verbose > /tmp/openclaw.log 2>&1 &
'
echo "[$(date)] OpenClaw 已重启"
fi
# 每 30 秒检查一次
sleep 30
done