From 9ce69e94cf02bb2cb798d3782363a1bf64296b9d Mon Sep 17 00:00:00 2001 From: "manuel.maier" Date: Fri, 23 Jan 2026 23:34:17 +0100 Subject: [PATCH] create_pve-mgnt-lxc.sh aktualisiert --- create_pve-mgnt-lxc.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/create_pve-mgnt-lxc.sh b/create_pve-mgnt-lxc.sh index 09a1921..6c4d700 100644 --- a/create_pve-mgnt-lxc.sh +++ b/create_pve-mgnt-lxc.sh @@ -3,8 +3,7 @@ # Proxmox VE: Debian 13 LXC automatisch erstellen # Hostname: -MGNT # Unprivilegiert, Passwort optional -# DNS vom Host übernehmen -# Dynamisches Template +# Automatisches Debian 13 Template # ===================================================== # ---- Konfiguration ---- @@ -12,7 +11,7 @@ IP="10.60.10.2/24" GATEWAY="10.60.10.1" CORES=1 MEMORY=512 -SWAP=512 +SWAP=0 STORAGE="local-lvm" ROOTFS_SIZE=8 BRIDGE="xx_vmbrmgt" @@ -49,7 +48,7 @@ echo -e "${INDENT}Nächste freie VMID: $VMID" # ---- Template automatisch wählen ---- echo -e "${INDENT}Suche aktuelles Debian 13 Template..." pveam update -TEMPLATE_NAME=$(pveam available | awk '/debian-13-standard_.*_amd64\.tar\.zst/ {print $1}' | tail -n1) +TEMPLATE_NAME=$(pveam available | awk '/debian-13-standard_.*_amd64\.tar\.zst/ {print $2}' | tail -n1) if [[ -z "$TEMPLATE_NAME" ]]; then echo -e "${BOLD}${INDENT}Kein Debian 13 Template gefunden!${RESET}" @@ -66,13 +65,6 @@ else echo -e "${INDENT}Template bereits vorhanden" fi -# ---- Host DNS übernehmen ---- -HOST_DNS=$(grep -E "^nameserver" /etc/resolv.conf | awk '{print $2}' | tr '\n' ',' | sed 's/,$//') -if [[ -z "$HOST_DNS" ]]; then - HOST_DNS="1.1.1.1" -fi -echo -e "${INDENT}Verwende Host-DNS: $HOST_DNS" - # ---- LXC erstellen ---- echo -e "${INDENT}Erstelle unprivilegierten LXC $HOSTNAME (VMID: $VMID)..." @@ -83,7 +75,7 @@ CREATE_CMD="pct create $VMID local:vztmpl/$TEMPLATE_NAME \ --swap $SWAP \ --rootfs $STORAGE:$ROOTFS_SIZE \ --net0 name=eth0,bridge=$BRIDGE,ip=$IP,gw=$GATEWAY,type=veth \ - --unprivileged 1 " + --unprivileged 1" # Passwort hinzufügen, falls gesetzt if [[ -n "$ROOTPASS" ]]; then