From f6c263b70384f780b10172b9e93b86b4ebbdf4a9 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Mon, 3 Feb 2025 11:44:37 +0100 Subject: [PATCH] update build.func --- misc/build.func | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index 154402c0..9348d121 100644 --- a/misc/build.func +++ b/misc/build.func @@ -734,7 +734,7 @@ config_file(){ fi if [[ ! -z "$CT_ID" ]]; then - if [[ "$CT_ID" =~ ^[0-9]{4}-[0-9]{4}$ ]]; then + if [[ "$CT_ID" =~ ^[0-9]{3,4}-[0-9]{3,4}$ ]]; then MIN_ID=${BASH_REMATCH[1]} MAX_ID=${BASH_REMATCH[2]} @@ -749,10 +749,10 @@ config_file(){ done echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}" + elif [[ "$CT_ID" =~ ^[0-9]+$ ]]; then LIST_OF_IDS=$( pvesh get /cluster/resources --type vm --output-format json | jq '.[] .vmid' -r) - if ! grep -q "^$CT_ID$" <<< "$LIST_OF_IDS"; then echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}" else