| #!/bin/bash |
|
|
| set -e |
|
|
| |
| mkdir -p /root/.openclaw/agents/main/sessions |
| mkdir -p /root/.openclaw/credentials |
| mkdir -p /root/.openclaw/sessions |
|
|
| |
| python3 /app/sync.py restore |
|
|
| |
| CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g") |
|
|
| |
| cat > /root/.openclaw/openclaw.json <<EOF |
| { |
| "models": { |
| "providers": { |
| "nvidia": { |
| "baseUrl": "$CLEAN_BASE", |
| "apiKey": "$OPENAI_API_KEY", |
| "api": "openai-completions", |
| "models": [ |
| { "id": "$MODEL", "name": "$MODEL", "contextWindow": 128000 } |
| ] |
| } |
| } |
| }, |
| "agents": { "defaults": { "model": { "primary": "nvidia/$MODEL" } } }, |
| "commands": { |
| "restart": true |
| }, |
| "gateway": { |
| "mode": "local", |
| "bind": "lan", |
| "port": $PORT, |
| "trustedProxies": ["0.0.0.0/0"], |
| "auth": { "mode": "token", "token": "$OPENCLAW_GATEWAY_PASSWORD" }, |
| "controlUi": { |
| "enabled": true, |
| "allowInsecureAuth": true, |
| "dangerouslyDisableDeviceAuth": true, |
| "dangerouslyAllowHostHeaderOriginFallback": true |
| }, |
| } |
| } |
| EOF |
|
|
| |
| (while true; do sleep 3600; python3 /app/sync.py backup; done) & |
|
|
| |
| openclaw doctor --fix |
|
|
| exec openclaw gateway run --port $PORT |
|
|