Update 00-global_var.sh

This commit is contained in:
Alexandre
2022-02-17 15:32:29 +01:00
parent 84fa12f646
commit d0e521892e

View File

@@ -10,14 +10,14 @@ JSONSOURCE="/data/options.json"
# Export keys as env variables # Export keys as env variables
# echo "All addon options were exported as variables" # echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}")
for KEYS in "${arr[@]}"; do for KEYS in "${arr[@]}"; do
# export key # export key
VALUE=$(jq ."$KEYS" ${JSONSOURCE}) VALUE=$(jq ."$KEYS" "${JSONSOURCE}")
line="${KEYS}=${VALUE//[\"\']/}" line="${KEYS}=${VALUE//[\"\']/}"
# Use locally # Use locally
if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then
bashio::log.blue "${KEYS}=******" bashio::log.blue "${KEYS}=******"
else else
bashio::log.blue "$line" bashio::log.blue "$line"