From 9e63a4ff1fb404ec083d77ee4498ed51161fee71 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Wed, 1 Dec 2021 22:23:56 +0100 Subject: [PATCH] Allow spaces in yaml --- paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh | 5 +++-- webtrees/rootfs/scripts/90-config_yaml.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh b/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh index b04f6ffd3..374def0e8 100644 --- a/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh +++ b/paperless_ng/rootfs/etc/cont-init.d/90-config_yaml.sh @@ -63,7 +63,8 @@ function parse_yaml { # Get variables and export bashio::log.info "Starting the app with the variables in $CONFIGSOURCE" -for word in $(parse_yaml "$CONFIGSOURCE" ""); do +eval parse_yaml "$CONFIGSOURCE" "" >listtmp +cat listtmp | while read word || [[ -n $word ]]; do # Clean output word=${word//[\"\']/} # Data validation @@ -77,4 +78,4 @@ for word in $(parse_yaml "$CONFIGSOURCE" ""); do fi # Color text sed -i "1a echo \$(tput setaf 2)Exporting ENV variables :\$(tput setaf 0)" /etc/services.d/*/run # Show text in colour -done +done && rm listtmp diff --git a/webtrees/rootfs/scripts/90-config_yaml.sh b/webtrees/rootfs/scripts/90-config_yaml.sh index b04f6ffd3..374def0e8 100644 --- a/webtrees/rootfs/scripts/90-config_yaml.sh +++ b/webtrees/rootfs/scripts/90-config_yaml.sh @@ -63,7 +63,8 @@ function parse_yaml { # Get variables and export bashio::log.info "Starting the app with the variables in $CONFIGSOURCE" -for word in $(parse_yaml "$CONFIGSOURCE" ""); do +eval parse_yaml "$CONFIGSOURCE" "" >listtmp +cat listtmp | while read word || [[ -n $word ]]; do # Clean output word=${word//[\"\']/} # Data validation @@ -77,4 +78,4 @@ for word in $(parse_yaml "$CONFIGSOURCE" ""); do fi # Color text sed -i "1a echo \$(tput setaf 2)Exporting ENV variables :\$(tput setaf 0)" /etc/services.d/*/run # Show text in colour -done +done && rm listtmp