From 1e9036acf2b2ae0f972d9fab9994eb096c57c4ab Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:32:19 +0200 Subject: [PATCH] Update create_lxc.sh --- misc/create_lxc.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index fdeb0424..f70803b7 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -57,7 +57,8 @@ function check_storage_support() { local CURRENT_NAME="" CURRENT_TYPE="" CURRENT_CONTENTS=() while IFS= read -r line || [[ -n "$line" ]]; do - if [[ "$line" =~ ^([a-z0-9]+):[[:space:]]*([a-zA-Z0-9_-]+) ]]; then + # Match Speicher-Typ und Name + if [[ "$line" =~ ^(dir|lvm|lvmthin|zfspool):[[:space:]]*([a-zA-Z0-9._-]+) ]]; then [[ -n "$CURRENT_NAME" ]] && { if [[ " ${CURRENT_CONTENTS[*]} " =~ " $CONTENT " ]]; then VALID_STORAGES+=("$CURRENT_NAME") @@ -66,7 +67,11 @@ function check_storage_support() { } CURRENT_TYPE="${BASH_REMATCH[1]}" CURRENT_NAME="${BASH_REMATCH[2]}" - elif [[ "$line" =~ ^[[:space:]]*content[[:space:]]*[=]?[[:space:]]*(.+)$ ]]; then + continue + fi + + # Match content-Zeile + if [[ "$line" =~ ^[[:space:]]*content[[:space:]]*=?[[:space:]]*(.+)$ ]]; then IFS=',' read -ra PARTS <<<"${BASH_REMATCH[1]}" for c in "${PARTS[@]}"; do CURRENT_CONTENTS+=("$(echo "$c" | xargs)") @@ -74,17 +79,14 @@ function check_storage_support() { fi done