From 55efd85a1127b450a320adc4146508398b4b524a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 21 Aug 2025 10:31:39 +0200 Subject: [PATCH] Update create_lxc.sh --- misc/create_lxc.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index c986bd7b..72200f8f 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -6,7 +6,7 @@ # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # This sets verbose mode if the global variable is set to "yes" -if [ "$VERBOSE" == "yes" ]; then set -x; fi +if [ "$CREATE_LXC_VERBOSE" == "yes" ]; then set -x; fi if command -v curl >/dev/null 2>&1; then source <(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/core.func) @@ -255,18 +255,17 @@ fi # Update LXC template list TEMPLATE_SEARCH="${PCT_OSTYPE}-${PCT_OSVERSION:-}" case "$PCT_OSTYPE" in - debian|ubuntu) - TEMPLATE_PATTERN="-standard_" - ;; - alpine|fedora|rocky|centos) - TEMPLATE_PATTERN="-default_" - ;; - *) - TEMPLATE_PATTERN="" - ;; +debian | ubuntu) + TEMPLATE_PATTERN="-standard_" + ;; +alpine | fedora | rocky | centos) + TEMPLATE_PATTERN="-default_" + ;; +*) + TEMPLATE_PATTERN="" + ;; esac - # 1. Check local templates first msg_info "Searching for template '$TEMPLATE_SEARCH'" mapfile -t TEMPLATES < <( @@ -284,12 +283,11 @@ else pveam update >/dev/null 2>&1 && pveam available -section system | sed -n "s/.*\($TEMPLATE_SEARCH.*$TEMPLATE_PATTERN.*\)/\1/p" | - sort -t - -k 2 -V + sort -t - -k 2 -V ) TEMPLATE_SOURCE="online" fi - TEMPLATE="${TEMPLATES[-1]}" TEMPLATE_PATH="$(pvesm path $TEMPLATE_STORAGE:vztmpl/$TEMPLATE 2>/dev/null || echo "/var/lib/vz/template/cache/$TEMPLATE")"