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" \