diff --git a/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml b/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh similarity index 83% rename from paperless_ng/rootfs/etc/cont-init.d/90-config_yaml rename to paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh index 778de6816..f53744447 100644 --- a/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml +++ b/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh @@ -41,10 +41,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; @@ -63,7 +63,8 @@ for word in $(parse_yaml "$CONFIGSOURCE" ""); do word=${word//[\"\']/} # Data validation if [[ $word =~ ^.+[=].+$ ]]; then - sed -i "1a export $word" /etc/services.d/*/run # Export the variable + sed -i "1a export $word" /etc/services.d/*/run # Export the variable + blue=4 && sed -i "1a echo \"$(tput setaf $blue)ENV exported : $word$(tput sgr0)\"" aze # Show text in blue bashio::log.blue "$word" else bashio::log.fatal "$word does not follow the structure KEY=text, it will be ignored and removed from the config" diff --git a/zzz_templates/show_text_color b/zzz_templates/show_text_color new file mode 100644 index 000000000..a2bf15323 --- /dev/null +++ b/zzz_templates/show_text_color @@ -0,0 +1,8 @@ +#Define colors +red=1 +green=2 +yellow=3 +blue=4 +violet=5 +teal=6 +echo "$(tput setaf $red)ENV exported : $word$(tput sgr0)"