From f12034bab9af36a09c98215559b3e693a29e8cf4 Mon Sep 17 00:00:00 2001 From: Lutz Finsterle Date: Sat, 1 Aug 2026 10:03:12 +0200 Subject: [PATCH] apply-policies: fix header always showing [dry-run] ${DRY:+...} expanded on DRY=0 (non-empty). Gate the label on DRY=1 instead; the apply logic was already correct. Co-Authored-By: Claude Opus 4.8 --- scripts/apply-policies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/apply-policies.sh b/scripts/apply-policies.sh index 8d37b45..136817a 100755 --- a/scripts/apply-policies.sh +++ b/scripts/apply-policies.sh @@ -20,7 +20,7 @@ TOKEN="${BAO_TOKEN:-}" # functional comparison: ignore comments and blank lines norm(){ grep -vE '^[[:space:]]*#' | grep -vE '^[[:space:]]*$' | sed 's/[[:space:]]*$//'; } -echo "${DRY:+[dry-run] }policies under $DIR -> $ADDR" +echo "$([ "$DRY" = 1 ] && printf '[dry-run] ')policies under $DIR -> $ADDR" for f in "$DIR"/*.hcl; do name="$(basename "$f" .hcl)"; filetxt="$(cat "$f")" live="$(curl -sS -H "X-Vault-Token: $TOKEN" "$ADDR/v1/sys/policies/acl/$name" \