← Back to Skills Marketplace
273
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install gateway-delayed-restart
Description
延迟指定分钟数重启 OpenClaw Gateway,支持自定义延迟并通过飞书主动通知完成情况。
README (SKILL.md)
Gateway Delayed Restart - 延迟重启网关技能
📋 技能概述
在指定延迟后重启 OpenClaw Gateway,完成后主动通知。
核心能力:
- ⏰ 延迟执行重启
- 📝 支持自定义延迟时间
- 🔧 自动执行重启命令
- 📱 完成后主动通知(飞书消息)
🚀 快速开始
基础用法
# 2 分钟后重启
openclaw message send --channel feishu --target ou_xxxxx --message "/restart-gateway 2"
# 或直接执行
./skills/gateway-delayed-restart/restart.sh 2
Python 调用
import subprocess
import time
def restart_gateway(delay_minutes=2):
"""延迟重启网关"""
delay_seconds = delay_minutes * 60
time.sleep(delay_seconds)
subprocess.run(['openclaw', 'gateway', 'restart'])
print(f"✅ Gateway 已重启(延迟 {delay_minutes} 分钟)")
📚 完整参数
| 参数 | 默认值 | 说明 |
|---|---|---|
delay_minutes |
2 | 延迟分钟数 |
notify |
true | 是否发送通知 |
channel |
feishu | 通知渠道 |
target |
- | 通知目标 ID |
🎯 使用场景
场景 1: 浏览器故障后重启
# 浏览器超时,2 分钟后重启
./restart.sh 2
场景 2: 定时维护
# 10 分钟后重启进行维护
./restart.sh 10
场景 3: 等待任务完成后重启
# 等待任务完成
wait_for_task()
# 然后重启
restart_gateway(0) # 立即重启
🔧 脚本实现
Bash 版本
#!/bin/bash
# restart.sh - 延迟重启网关脚本
DELAY_MINUTES=${1:-2}
DELAY_SECONDS=$((DELAY_MINUTES * 60))
echo "⏰ 将在 ${DELAY_MINUTES} 分钟后重启 Gateway..."
echo "📅 重启时间:$(date -d "+${DELAY_MINUTES} minutes" '+%H:%M:%S')"
sleep $DELAY_SECONDS
echo "🔄 正在重启 Gateway..."
openclaw gateway restart
echo "✅ Gateway 重启完成!"
Python 版本
#!/usr/bin/env python3
"""延迟重启 OpenClaw Gateway"""
import subprocess
import time
import sys
from datetime import datetime, timedelta
def restart_gateway(delay_minutes=2, notify=True):
"""
延迟重启网关
Args:
delay_minutes: 延迟分钟数
notify: 是否发送通知
"""
restart_time = datetime.now() + timedelta(minutes=delay_minutes)
print(f"⏰ 将在 {delay_minutes} 分钟后重启 Gateway")
print(f"📅 重启时间:{restart_time.strftime('%H:%M:%S')}")
# 倒计时
for remaining in range(delay_minutes * 60, 0, -60):
mins = remaining // 60
secs = remaining % 60
print(f"\r⏳ 剩余:{mins}分{secs}秒", end='', flush=True)
time.sleep(60)
print("\
🔄 正在重启 Gateway...")
result = subprocess.run(
['openclaw', 'gateway', 'restart'],
capture_output=True,
text=True
)
if result.returncode == 0:
print("✅ Gateway 重启成功!")
else:
print(f"❌ 重启失败:{result.stderr}")
return result.returncode == 0
if __name__ == '__main__':
delay = int(sys.argv[1]) if len(sys.argv) > 1 else 2
restart_gateway(delay)
📝 完整技能结构
skills/gateway-delayed-restart/
├── SKILL.md # 本文档
├── restart.sh # Bash 版本
├── restart.py # Python 版本
├── _meta.json # 元数据
└── README.md # 快速说明
⚠️ 注意事项
- 延迟时间: 建议 1-10 分钟,不要太长
- 权限: 确保有执行
openclaw gateway restart的权限 - 通知: 重启前最好通知相关人员
- 保存工作: 重启前确保保存正在进行的工作
🧪 测试清单
- 2 分钟延迟重启
- 立即重启 (0 分钟)
- 5 分钟延迟重启
- 重启后 Gateway 状态正常
- 通知功能正常
📚 相关资源
版本: v1.1
创建时间: 2026-03-14 10:07 AM
更新时间: 2026-03-14 10:15 AM
作者: Han's AI Assistant
状态: ✅ 已创建(带完成通知)
Usage Guidance
This skill appears to do exactly what it says: wait, run 'openclaw gateway restart', and optionally send a Feishu notification. Before installing, verify: (1) the host has the 'openclaw' CLI and it's authenticated to perform gateway restarts and send Feishu messages; (2) you have permission to restart the gateway (this will interrupt service); (3) the hard-coded Feishu target (ou_6650e2645a6e8f4c7363cbbfd6bbcf33) is acceptable — consider editing the script to use a configurable target or confirm it points to the correct recipient; (4) test in a safe environment (non-production) so unexpected restarts don't impact users. The main issues are omission in the manifest (declare 'openclaw' as a required binary) and the hard-coded notification target — these are operational/documentation problems, not evidence of malicious behavior.
Capability Analysis
Type: OpenClaw Skill
Name: gateway-delayed-restart
Version: 1.1.0
The skill bundle contains a hardcoded Feishu target ID (ou_6650e2645a6e8f4c7363cbbfd6bbcf33) in both restart.sh and restart.py. This causes the scripts to send execution reports, including status and process IDs (PID), to an external recipient regardless of user configuration. While the primary function of restarting the gateway is legitimate, this hardcoded telemetry to a specific external entity is suspicious and could be used for tracking or minor data exfiltration.
Capability Assessment
Purpose & Capability
The name/description (delayed restart + notification) aligns with the included scripts: both restart.sh and restart.py wait, call 'openclaw gateway restart', collect simple status info, and send a Feishu message. Small mismatch: the registry metadata lists no required binaries or env vars, but the scripts clearly require the 'openclaw' CLI and standard system utilities (pgrep, date, sleep). This is a documentation/manifest omission rather than functional misdirection.
Instruction Scope
SKILL.md and the scripts limit their actions to waiting, invoking 'openclaw gateway restart', querying the gateway PID via pgrep, printing a report, and sending a notification via 'openclaw message send'. The instructions do not read arbitrary user files, environment secrets, or contact unknown external endpoints directly (they rely on the OpenClaw CLI for messaging).
Install Mechanism
No install spec — instruction-only with bundled scripts. Files are plain shell/Python; nothing downloads or extracts remote archives. Risk from install mechanism is low.
Credentials
The skill declares no environment variables or primary credential, but it implicitly depends on the OpenClaw CLI being configured with credentials to send Feishu messages and to perform gateway restarts. That dependence is plausible for this function, but the manifest should declare the 'openclaw' CLI requirement and document that the CLI must be authenticated. Also, the notification target is hard-coded (ou_6650e264...), contrary to SKILL.md examples that imply a configurable target — this reduces flexibility and may post to an unexpected recipient if installed in a different org.
Persistence & Privilege
always is false and the skill does not persistently modify system or other skills' configurations. It requires permission to run the 'openclaw gateway restart' command (expected for its function), but it does not request elevated persistent privileges or change other skills' settings.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install gateway-delayed-restart - After installation, invoke the skill by name or use
/gateway-delayed-restart - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Delayed restart with completion notification via Feishu
Metadata
Frequently Asked Questions
What is Gateway Delayed Restart?
延迟指定分钟数重启 OpenClaw Gateway,支持自定义延迟并通过飞书主动通知完成情况。 It is an AI Agent Skill for Claude Code / OpenClaw, with 273 downloads so far.
How do I install Gateway Delayed Restart?
Run "/install gateway-delayed-restart" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Gateway Delayed Restart free?
Yes, Gateway Delayed Restart is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Gateway Delayed Restart support?
Gateway Delayed Restart is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Gateway Delayed Restart?
It is built and maintained by hanl754 (@hanl754); the current version is v1.1.0.
More Skills