HA add-on: optional doctor on startup (faster restarts)
This commit is contained in:
@@ -31,6 +31,9 @@ options:
|
|||||||
gateway_port: 18789
|
gateway_port: 18789
|
||||||
gateway_token: ""
|
gateway_token: ""
|
||||||
|
|
||||||
|
# Run `clawdbot doctor --fix` on startup (useful after upgrades; slows restarts)
|
||||||
|
run_doctor_on_start: false
|
||||||
|
|
||||||
homeassistant_token: ""
|
homeassistant_token: ""
|
||||||
mikrotik_host: "192.168.88.1"
|
mikrotik_host: "192.168.88.1"
|
||||||
mikrotik_ssh_user: "papur"
|
mikrotik_ssh_user: "papur"
|
||||||
@@ -44,6 +47,7 @@ schema:
|
|||||||
gateway_bind: list(loopback|lan)
|
gateway_bind: list(loopback|lan)
|
||||||
gateway_port: int
|
gateway_port: int
|
||||||
gateway_token: str?
|
gateway_token: str?
|
||||||
|
run_doctor_on_start: bool
|
||||||
homeassistant_token: str?
|
homeassistant_token: str?
|
||||||
mikrotik_host: str
|
mikrotik_host: str
|
||||||
mikrotik_ssh_user: str
|
mikrotik_ssh_user: str
|
||||||
|
|||||||
+10
-4
@@ -126,10 +126,16 @@ MikroTik SSH:
|
|||||||
key=${MT_KEY}
|
key=${MT_KEY}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Running clawdbot doctor (auto-fix) ..."
|
RUN_DOCTOR=$(jq -r '.run_doctor_on_start // false' "$OPTIONS_FILE")
|
||||||
# Doctor is idempotent; but in containers it can occasionally hang on environment checks.
|
|
||||||
# Put a hard timeout so the gateway still starts.
|
if [ "$RUN_DOCTOR" = "true" ]; then
|
||||||
(timeout 60s clawdbot doctor --fix --yes) || true
|
echo "Running clawdbot doctor (auto-fix) ..."
|
||||||
|
# Doctor is idempotent; but in containers it can occasionally hang on environment checks.
|
||||||
|
# Put a hard timeout so the gateway still starts.
|
||||||
|
(timeout 60s clawdbot doctor --fix --yes) || true
|
||||||
|
else
|
||||||
|
echo "Skipping clawdbot doctor on startup (run_doctor_on_start=false)"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Starting Clawdbot Gateway..."
|
echo "Starting Clawdbot Gateway..."
|
||||||
exec clawdbot gateway run
|
exec clawdbot gateway run
|
||||||
|
|||||||
Reference in New Issue
Block a user