#!/usr/bin/env bash set -Eeuo pipefail readonly INSTALLER_URL="https://openclaw.ai/install.sh" readonly SCRIPT_NAME="$(basename "$0")" show_help() { cat <&2 show_help >&2 exit 2 ;; esac done if [[ "$(uname -s)" != "Linux" ]]; then printf 'Error: este script está pensado para Linux/WSL2.\n' >&2 exit 1 fi if ! command -v curl >/dev/null 2>&1; then printf 'Error: curl es obligatorio. Instálalo con: sudo apt-get update && sudo apt-get install -y curl\n' >&2 exit 1 fi installer_file="$(mktemp)" cleanup() { rm -f "$installer_file" } trap cleanup EXIT printf 'Descargando el instalador oficial de OpenClaw...\n' curl --fail --silent --show-error --location \ --proto '=https' --tlsv1.2 \ "$INSTALLER_URL" -o "$installer_file" if [[ "$onboard" == true ]]; then bash "$installer_file" else bash "$installer_file" --no-onboard fi printf '\nOpenClaw se ha instalado. Comprueba la instalación con:\n' printf ' openclaw --version\n' printf ' openclaw doctor\n' if [[ "$onboard" == false ]]; then printf '\nPara configurar OpenClaw más adelante, ejecuta:\n' printf ' openclaw onboard --install-daemon\n' fi