update build.func

This commit is contained in:
Rögl-Brunner Michel 2025-02-07 08:56:21 +01:00
parent 7974bfdddb
commit fc303669e3

View File

@ -744,7 +744,7 @@ config_file(){
exit exit
fi fi
LIST_OF_IDS=$( pvesh get /cluster/resources --type vm --output-format json | jq '.[] .vmid' -r) LIST_OF_IDS=$(pvesh get /cluster/resources --type vm --output-format json | grep -oP '"vmid":\s*\K\d+' )
for ((ID=MIN_ID; ID<=MAX_ID; ID++)); do for ((ID=MIN_ID; ID<=MAX_ID; ID++)); do
if ! grep -q "^$ID$" <<< "$LIST_OF_IDS"; then if ! grep -q "^$ID$" <<< "$LIST_OF_IDS"; then
@ -757,7 +757,7 @@ config_file(){
elif [[ "$CT_ID" =~ ^[0-9]+$ ]]; then elif [[ "$CT_ID" =~ ^[0-9]+$ ]]; then
LIST_OF_IDS=$( pvesh get /cluster/resources --type vm --output-format json | jq '.[] .vmid' -r) LIST_OF_IDS=$(pvesh get /cluster/resources --type vm --output-format json | grep -oP '"vmid":\s*\K\d+' )
if ! grep -q "^$CT_ID$" <<< "$LIST_OF_IDS"; then if ! grep -q "^$CT_ID$" <<< "$LIST_OF_IDS"; then
echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}" echo -e "${CONTAINERID}${BOLD}${DGN}Container ID: ${BGN}$CT_ID${CL}"
else else