#!/usr/bin/env bash # Install or update ShellBook in a Proxmox CT in one step, leaving nothing on the host. # Run on the Proxmox host as root: # bash -c "$(curl -fsSL https://git.finalfactory.de/FinalFactory/ShellBook/raw/branch/main/deploy/proxmox/bootstrap.sh)" # Accepts the overrides of create-ct.sh (CTID, CT_*, SHELLBOOK_*, TS_AUTHKEY). # The repository is unpacked into a temporary directory that is always removed. set -euo pipefail [[ $EUID == 0 ]] && command -v pct >/dev/null || { echo 'Run on the Proxmox host as root' >&2; exit 1; } archive=${SHELLBOOK_ARCHIVE_URL:-https://git.finalfactory.de/FinalFactory/ShellBook/archive/${SHELLBOOK_REF:-main}.tar.gz} work=$(mktemp -d) trap 'rm -rf -- "$work"' EXIT curl -fsSL "$archive" | tar -xz -C "$work" --strip-components=1 --no-same-owner [[ -f $work/deploy/proxmox/create-ct.sh ]] || { echo "No ShellBook deploy scripts in $archive" >&2; exit 1; } # stdin stays away from pct exec: callers may pipe this script into bash. bash "$work/deploy/proxmox/create-ct.sh"