diff --git a/zzz_templates/00-global_var.sh b/zzz_templates/00-global_var.sh index 5a47bacdf..549edb4d9 100644 --- a/zzz_templates/00-global_var.sh +++ b/zzz_templates/00-global_var.sh @@ -16,11 +16,10 @@ for KEYS in ${arr[@]}; do line="${KEYS}=${VALUE//[\"\']/}" # Use locally if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi - export $line - # Export the variable to run scripts - line="${KEYS}=${VALUE//[\"\']/} &>/dev/null" - sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null - sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null +# Export the variable to run scripts + line="${KEYS}=${VALUE//[\"\']/} 2>/dev/null || true" + [ -f /etc/services.d/*/*run* ] && sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || true + [ -f /etc/cont-init.d/*run* ] && sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null || true done ################