diff --git a/scripts/proxmox/install-linkvault.sh b/scripts/proxmox/install-linkvault.sh index da3d418..57ba8aa 100755 --- a/scripts/proxmox/install-linkvault.sh +++ b/scripts/proxmox/install-linkvault.sh @@ -54,12 +54,18 @@ echo "==> Netzwerk: $CT_BRIDGE / $CT_IP" # --------------------------------------------------------------------------- # Debian-12-Template sicherstellen # --------------------------------------------------------------------------- -TEMPLATE="debian-12-standard_12.7-1_amd64.tar.zst" -if ! pveam list "$TEMPLATE_STORAGE" | grep -q "$TEMPLATE"; then +TEMPLATE="$(pveam list "$TEMPLATE_STORAGE" | awk '{print $1}' | grep -o 'debian-12-standard_[^ ]*\.tar\.zst' | sort -V | tail -n1)" +if [ -z "$TEMPLATE" ]; then echo "==> Lade Debian-12-Template herunter..." pveam update + TEMPLATE="$(pveam available --section system | awk '{print $2}' | grep '^debian-12-standard_.*\.tar\.zst$' | sort -V | tail -n1)" + if [ -z "$TEMPLATE" ]; then + echo "Fehler: Kein debian-12-standard-Template in 'pveam available' gefunden." >&2 + exit 1 + fi pveam download "$TEMPLATE_STORAGE" "$TEMPLATE" fi +echo "==> Verwende Template: $TEMPLATE" # --------------------------------------------------------------------------- # LXC-Container anlegen