Update start-openclaw.sh
Browse files- start-openclaw.sh +45 -1
start-openclaw.sh
CHANGED
|
@@ -98,7 +98,6 @@ echo " - 配置通道 (openclaw.json): ${HAS_CHANNEL_CONFIG}"
|
|
| 98 |
if [[ "$HAS_ACCOUNTS" == true && "$HAS_CHANNEL_CONFIG" == true ]]; then
|
| 99 |
echo "✅ 两个条件全部满足 → 执行快速激活(尽量不扫码)"
|
| 100 |
|
| 101 |
-
# 轻量启用
|
| 102 |
openclaw config set plugins.entries.openclaw-weixin.enabled true || true
|
| 103 |
openclaw channels enable openclaw-weixin 2>/dev/null || true
|
| 104 |
|
|
@@ -122,3 +121,48 @@ else
|
|
| 122 |
]
|
| 123 |
}
|
| 124 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
if [[ "$HAS_ACCOUNTS" == true && "$HAS_CHANNEL_CONFIG" == true ]]; then
|
| 99 |
echo "✅ 两个条件全部满足 → 执行快速激活(尽量不扫码)"
|
| 100 |
|
|
|
|
| 101 |
openclaw config set plugins.entries.openclaw-weixin.enabled true || true
|
| 102 |
openclaw channels enable openclaw-weixin 2>/dev/null || true
|
| 103 |
|
|
|
|
| 121 |
]
|
| 122 |
}
|
| 123 |
}
|
| 124 |
+
},
|
| 125 |
+
"agents": {
|
| 126 |
+
"defaults": {
|
| 127 |
+
"model": { "primary": "nvidia/$MODEL" }
|
| 128 |
+
}
|
| 129 |
+
},
|
| 130 |
+
"commands": {
|
| 131 |
+
"restart": true
|
| 132 |
+
},
|
| 133 |
+
"gateway": {
|
| 134 |
+
"mode": "local",
|
| 135 |
+
"bind": "lan",
|
| 136 |
+
"port": $PORT,
|
| 137 |
+
"trustedProxies": ["0.0.0.0/0"],
|
| 138 |
+
"auth": { "mode": "token", "token": "$OPENCLAW_GATEWAY_PASSWORD" },
|
| 139 |
+
"controlUi": {
|
| 140 |
+
"enabled": true,
|
| 141 |
+
"allowInsecureAuth": true,
|
| 142 |
+
"dangerouslyDisableDeviceAuth": true,
|
| 143 |
+
"dangerouslyAllowHostHeaderOriginFallback": true
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
EOF
|
| 148 |
+
|
| 149 |
+
# 执行完整安装
|
| 150 |
+
npx -y @tencent-weixin/openclaw-weixin-cli@latest install
|
| 151 |
+
fi
|
| 152 |
+
|
| 153 |
+
echo "✅ 微信插件激活流程完成"
|
| 154 |
+
|
| 155 |
+
# ================================================
|
| 156 |
+
# 6. 启动定时备份(每1小时一次)
|
| 157 |
+
# ================================================
|
| 158 |
+
echo "⏰ 启动定时备份任务(每1小时)..."
|
| 159 |
+
(while true; do
|
| 160 |
+
sleep 3600;
|
| 161 |
+
python3 /app/sync.py backup;
|
| 162 |
+
done) &
|
| 163 |
+
|
| 164 |
+
# ================================================
|
| 165 |
+
# 7. 启动 OpenClaw Gateway
|
| 166 |
+
# ================================================
|
| 167 |
+
echo "🌟 启动 OpenClaw Gateway..."
|
| 168 |
+
exec openclaw gateway run --port $PORT
|