From cc81871eab65b30619560534c5c1f05bd53bf264 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 4 Jan 2024 17:00:07 +0100 Subject: [PATCH] Disable for arrays --- .templates/00-global_var.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index b6599440c..2b58c3d68 100755 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -16,6 +16,11 @@ mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}") for KEYS in "${arr[@]}"; do # export key VALUE=$(jq ."$KEYS" "${JSONSOURCE}") + # Check if the value is an array + if [[ "$VALUE" == \[* ]]; then + bashio::log.warning "$VALUE is an array, skipping" + else + # Continue for single values VALUE="${VALUE//[\"\']/}" line="${KEYS}='${VALUE}'" # Check if secret @@ -59,7 +64,7 @@ for KEYS in "${arr[@]}"; do # For s6 if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi echo "export ${KEYS}='${VALUE}'" >> ~/.bashrc - + fi done ################