#!/usr/bin/env bash # ShipSquares install bootstrap — served at https://get.shipsquares.com/. # # curl -fsSL https://get.shipsquares.com | bash # curl -fsSL https://get.shipsquares.com | bash -s -- --domain ship.example.com # curl -fsSL https://get.shipsquares.com | SS_VERSION= bash # # This is a thin, pipe-safe bootstrap: it downloads the installer tree (install.sh # + lib/ + systemd/ + caddy/) and the compiled control-plane bundle, then runs the # real installer. install.sh can't be piped to bash directly because it sources # sibling lib/*.sh and installs systemd/ + caddy/ files relative to its own path. set -euo pipefail BASE="${SS_BASE:-https://get.shipsquares.com}" SS_VERSION="${SS_VERSION:-latest}" command -v curl >/dev/null 2>&1 || { echo "ShipSquares: curl is required" >&2; exit 1; } command -v tar >/dev/null 2>&1 || { echo "ShipSquares: tar is required" >&2; exit 1; } TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT echo "==> ShipSquares: fetching installer ($SS_VERSION) from $BASE" curl -fsSL "$BASE/installer.tgz" -o "$TMP/installer.tgz" tar xzf "$TMP/installer.tgz" -C "$TMP" # Where the installer pulls the compiled bundle from. Bundles are arch-specific # (the node-pty native addon is baked in), so the URL carries the arch. install.sh's # own default resolves to the same URL; we set it explicitly so a pinned SS_VERSION # works too. case "$(uname -m)" in x86_64) SS_ARCH=amd64 ;; aarch64|arm64) SS_ARCH=arm64 ;; *) SS_ARCH=amd64 ;; esac export SS_BUNDLE="${SS_BUNDLE:-$BASE/bundles/$SS_VERSION-$SS_ARCH.tgz}" export SS_VERSION exec bash "$TMP/infra/installer/install.sh" "$@"