diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index 93e6dcd99..dcfd16931 100644 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -29,11 +29,11 @@ mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}") # Escape special characters using printf and enclose in double quotes sanitize_variable() { - local input="$1" - local escaped_input - printf -v escaped_input '%q' "$input" - escaped_input=\"${escaped_input//\'/\'\'}\" - echo "$escaped_input" + local input="$1" + local escaped_input + printf -v escaped_input '%q' "$input" + escaped_input=\"${escaped_input//\'/\'\'}\" + echo "$escaped_input" } for KEYS in "${arr[@]}"; do @@ -43,10 +43,10 @@ for KEYS in "${arr[@]}"; do if [[ "$VALUE" == \[* ]]; then bashio::log.warning "One of your option is an array, skipping" else - # Sanitize variable - if [[ "$VALUE" != \'*\' ]]; then - VALUE=$(sanitize_variable "$VALUE") - fi + # Sanitize variable + if [[ "$VALUE" != \'*\' ]]; then + VALUE=$(sanitize_variable "$VALUE") + fi # Continue for single values line="${KEYS}=${VALUE}" # Check if secret