From 29641018693760c22241d6bbb60f3b5351a8b619 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 15 Jan 2022 07:33:29 +0100 Subject: [PATCH] Update 90-config_yaml.sh --- zzz_templates/90-config_yaml.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/zzz_templates/90-config_yaml.sh b/zzz_templates/90-config_yaml.sh index bad0832cb..a6181a32c 100644 --- a/zzz_templates/90-config_yaml.sh +++ b/zzz_templates/90-config_yaml.sh @@ -45,10 +45,10 @@ function parse_yaml { local prefix=$2 || local prefix="" local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @ | tr @ '\034') sed -ne "s|^\($s\):|\1|" \ - -e "s| #.*$||g" \ - -e "s|#.*$||g" \ - -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ - -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | + -e "s| #.*$||g" \ + -e "s|#.*$||g" \ + -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | awk -F$fs '{ indent = length($1)/2; vname[indent] = $2; @@ -81,10 +81,11 @@ while IFS= read -r line; do fi # Data validation if [[ $line =~ ^.+[=].+$ ]]; then - export $line 2> /dev/null + export $line # Export the variable - [ -f /etc/services.d/*/*run* ] && sed -i "1a export $line 2>/dev/null || true" /etc/services.d/*/*run* || true - [ -f /etc/cont-init.d/*run* ] && sed -i "1a export $line 2>/dev/null || true" /etc/cont-init.d/*run* || true + sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || true + sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null || true + sed -i "1a export $line" /scripts/*run* 2>/dev/null || true # Show in log if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi else