Update start-openclaw.sh
Browse files- start-openclaw.sh +24 -10
start-openclaw.sh
CHANGED
|
@@ -4,31 +4,29 @@ set -e
|
|
| 4 |
|
| 5 |
# 1. 补全目录
|
| 6 |
mkdir -p /root/.openclaw/agents/main/sessions
|
|
|
|
| 7 |
mkdir -p /root/.openclaw/credentials
|
| 8 |
mkdir -p /root/.openclaw/sessions
|
| 9 |
|
| 10 |
# 2. 执行恢复
|
| 11 |
python3 /app/sync.py restore
|
| 12 |
|
| 13 |
-
# 3.
|
| 14 |
-
CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g")
|
| 15 |
-
|
| 16 |
-
# 4. 生成配置文件
|
| 17 |
cat > /root/.openclaw/openclaw.json <<EOF
|
| 18 |
{
|
| 19 |
"models": {
|
| 20 |
"providers": {
|
| 21 |
-
"
|
| 22 |
-
"baseUrl": "
|
| 23 |
-
"apiKey": "
|
| 24 |
-
"api": "
|
| 25 |
"models": [
|
| 26 |
-
{ "id": "
|
| 27 |
]
|
| 28 |
}
|
| 29 |
}
|
| 30 |
},
|
| 31 |
-
"agents": { "defaults": { "model": { "primary": "
|
| 32 |
"commands": {
|
| 33 |
"restart": true
|
| 34 |
},
|
|
@@ -49,6 +47,22 @@ cat > /root/.openclaw/openclaw.json <<EOF
|
|
| 49 |
}
|
| 50 |
EOF
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
# 5. 启动定时备份 (每 1 小时)
|
| 53 |
(while true; do sleep 3600; python3 /app/sync.py backup; done) &
|
| 54 |
|
|
|
|
| 4 |
|
| 5 |
# 1. 补全目录
|
| 6 |
mkdir -p /root/.openclaw/agents/main/sessions
|
| 7 |
+
mkdir -p /root/.openclaw/agents/main/agent
|
| 8 |
mkdir -p /root/.openclaw/credentials
|
| 9 |
mkdir -p /root/.openclaw/sessions
|
| 10 |
|
| 11 |
# 2. 执行恢复
|
| 12 |
python3 /app/sync.py restore
|
| 13 |
|
| 14 |
+
# 3. 生成配置文件
|
|
|
|
|
|
|
|
|
|
| 15 |
cat > /root/.openclaw/openclaw.json <<EOF
|
| 16 |
{
|
| 17 |
"models": {
|
| 18 |
"providers": {
|
| 19 |
+
"ollama": {
|
| 20 |
+
"baseUrl": "https://o.iei.indevs.in",
|
| 21 |
+
"apiKey": "ollama",
|
| 22 |
+
"api": "ollama",
|
| 23 |
"models": [
|
| 24 |
+
{ "id": "qwen3.5:2b", "name": "qwen3.5:2b", "contextWindow": 8192 }
|
| 25 |
]
|
| 26 |
}
|
| 27 |
}
|
| 28 |
},
|
| 29 |
+
"agents": { "defaults": { "model": { "primary": "ollama/qwen3.5:2b" } } },
|
| 30 |
"commands": {
|
| 31 |
"restart": true
|
| 32 |
},
|
|
|
|
| 47 |
}
|
| 48 |
EOF
|
| 49 |
|
| 50 |
+
# 4. 生成 auth-profiles.json
|
| 51 |
+
cat > /root/.openclaw/agents/main/agent/auth-profiles.json <<EOF
|
| 52 |
+
{
|
| 53 |
+
"profiles": {
|
| 54 |
+
"default": {
|
| 55 |
+
"providers": {
|
| 56 |
+
"ollama": {
|
| 57 |
+
"apiKey": "ollama"
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
},
|
| 62 |
+
"activeProfile": "default"
|
| 63 |
+
}
|
| 64 |
+
EOF
|
| 65 |
+
|
| 66 |
# 5. 启动定时备份 (每 1 小时)
|
| 67 |
(while true; do sleep 3600; python3 /app/sync.py backup; done) &
|
| 68 |
|