From 86a4af3caf968a084a3812ad22e75396f49c2577 Mon Sep 17 00:00:00 2001 From: spektr Date: Fri, 27 Nov 2026 06:54:21 +0100 Subject: [PATCH] CT 114: awk-END-Block-Falle im storage_has_free behoben exit im Hauptblock wird vom END-Block ueberschrieben; Verdict jetzt ueber Flags im END-Block (Muster wie storage_is_active). Lokal gegen pvesm-Werte getestet (206 GiB frei -> PASS bei 182 GiB Gate). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- .../scripts/provision-ct114-litecoin.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxmox/lxc/ct-114-litecoin-wallet/scripts/provision-ct114-litecoin.sh b/proxmox/lxc/ct-114-litecoin-wallet/scripts/provision-ct114-litecoin.sh index 3b35ad8..eec8db5 100755 --- a/proxmox/lxc/ct-114-litecoin-wallet/scripts/provision-ct114-litecoin.sh +++ b/proxmox/lxc/ct-114-litecoin-wallet/scripts/provision-ct114-litecoin.sh @@ -64,15 +64,17 @@ storage_is_active() { storage_has_free() { local storage="$1" local required_gib="$2" + # Note: awk `exit` still runs the END block, so the verdict must be + # decided there via flags (same pattern as storage_is_active). pvesm status | awk -v storage="$storage" -v required="$required_gib" ' $1 == storage && $3 == "active" { avail_kib = $6 if (avail_kib ~ /^[0-9]+$/) { - exit(avail_kib / 1048576 >= required ? 0 : 1) + found = 1 + ok = (avail_kib / 1048576 >= required) } - exit 1 } - END { exit 1 } + END { exit(found && ok ? 0 : 1) } ' }