From 348daf8ad7076705c9093d0a50ce2979fab31c8a Mon Sep 17 00:00:00 2001 From: Lukas Remis Date: Wed, 16 Sep 2026 21:06:03 +0200 Subject: [PATCH] Deploy: `up` died on QuTS hero's older bash `compose "${profile[@]}" up -d "${build[@]}"` aborts with "profile[@]: unbound variable" on bash 4.3 and older, which treats expanding an EMPTY array under `set -u` as unbound. DSM ships a newer bash, so this only surfaced on QNAP. The ${arr[@]+"${arr[@]}"} form expands to nothing when empty and is identical otherwise. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018SqJYt7jD7oUEkoY68sBZo --- deploy/webmail.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy/webmail.sh b/deploy/webmail.sh index 9fc94b0..a77f358 100755 --- a/deploy/webmail.sh +++ b/deploy/webmail.sh @@ -363,8 +363,12 @@ cmd_up() { then re-run this command." fi detect_compose + # ${arr[@]+"${arr[@]}"} rather than plain "${arr[@]}": under `set -u`, bash + # 4.3 and older — which is what QuTS hero ships — treats expanding an EMPTY + # array as an unbound variable and aborts. The +-form expands to nothing at + # all when the array is empty, and is identical otherwise. # shellcheck disable=SC2086 - compose "${profile[@]}" up -d "${build[@]}" $COMPOSE_WAIT + compose ${profile[@]+"${profile[@]}"} up -d ${build[@]+"${build[@]}"} $COMPOSE_WAIT health_gate || die "services did not come up healthy — check: ./deploy/webmail.sh logs" record_version "${IMAGE_TAG:-local}" grn "up. open http://:${WEB_PORT:-8088}/"