From 23bde71355d97abffd574686f289d260a58ec78c Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:37:58 +0100 Subject: [PATCH] Update 00-global_var.sh --- .templates/00-global_var.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index ee52e91ad..ba3174faf 100644 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -15,7 +15,7 @@ mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}") for KEYS in "${arr[@]}"; do # export key VALUE=$(jq ."$KEYS" "${JSONSOURCE}") - line="${KEYS}=${VALUE//[\"\']/}" + line="${KEYS}=\"${VALUE//[\"\']/}\"" # Use locally if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then bashio::log.blue "${KEYS}=******" @@ -23,9 +23,8 @@ for KEYS in "${arr[@]}"; do bashio::log.blue "$line" fi # Export the variable to run scripts - line="${KEYS}=${VALUE//[\"\']/} 2>/dev/null || true" - if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export \"$line\"" /etc/services.d/*/*run* 2>/dev/null; fi - if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export \"$line\"" /etc/cont-init.d/*run* 2>/dev/null; fi + if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi + if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi done ################