#!/bin/bash # # Gatewarden bootstrap installer # # Usage: curl -fsSL https://get.gatewarden.net | sudo bash set -Eeuo pipefail INSTALL_URL="${GATEWARDEN_INSTALL_URL:-https://get.gatewarden.net/install}" TMP_FILE="$(mktemp)" cleanup() { rm -f "$TMP_FILE" } trap cleanup EXIT fetch_with_curl() { curl --ipv4 --http1.1 --compressed -fsSL \ --connect-timeout 10 \ --max-time 300 \ --retry 3 \ --retry-all-errors \ "$INSTALL_URL" -o "$TMP_FILE" } fetch_with_wget() { wget -4 -qO "$TMP_FILE" "$INSTALL_URL" } if command -v curl >/dev/null 2>&1; then fetch_with_curl elif command -v wget >/dev/null 2>&1; then fetch_with_wget else echo "curl or wget is required" >&2 exit 1 fi chmod 700 "$TMP_FILE" exec bash "$TMP_FILE"