diff --git a/install.sh b/install.sh index 9c3d9eb..042a7c7 100644 --- a/install.sh +++ b/install.sh @@ -186,11 +186,17 @@ mkdir -p "$XDG_RUNTIME_DIR" 2>/dev/null || true log "Instalando daemon del gateway (systemd usuario)..." "$OPENCLAW_BIN" daemon install --runtime node >/dev/null 2>&1 || warn "daemon install avisó algo; se intenta igual" systemctl --user daemon-reload 2>/dev/null || true -systemctl --user enable --now openclaw-gateway.service >/dev/null 2>&1 || { - warn "El servicio openclaw-gateway no arrancó al vuelo; reintentando..." - sleep 2 - systemctl --user start openclaw-gateway.service >/dev/null 2>&1 || true -} +systemctl --user enable openclaw-gateway.service >/dev/null 2>&1 || true +if systemctl --user is-active --quiet openclaw-gateway.service 2>/dev/null; then + log "Reiniciando gateway para tomar la config nueva..." + systemctl --user restart openclaw-gateway.service >/dev/null 2>&1 || true +else + systemctl --user start openclaw-gateway.service >/dev/null 2>&1 || { + warn "El servicio openclaw-gateway no arrancó al vuelo; reintentando..." + sleep 2 + systemctl --user start openclaw-gateway.service >/dev/null 2>&1 || true + } +fi sleep 4 # ---------------- 5) Verificación ----------------