Update create_lxc.sh

This commit is contained in:
CanbiZ 2025-08-19 11:37:52 +02:00
parent cd1e08b669
commit 454d95bd39

View File

@ -265,10 +265,11 @@ mapfile -t TEMPLATES < <(
)
# If nothing found online, search local templates (file names only)
# If nothing found online, search local templates (extract filename from volume ID)
if [ ${#TEMPLATES[@]} -eq 0 ]; then
msg_info "Online search failed or no template found. Checking for local fallbacks..."
mapfile -t TEMPLATES < <(
pveam list "$TEMPLATE_STORAGE" | awk -v s="$TEMPLATE_SEARCH" '$2 ~ s {print $2}' | sort -t - -k 2 -V
pveam list "$TEMPLATE_STORAGE" | awk -v s="$TEMPLATE_SEARCH" '$1 ~ s {print $1}' | sed 's/.*\///' | sort -t - -k 2 -V
)
if [ ${#TEMPLATES[@]} -eq 0 ]; then