From ce1ee82dcd75d6ddbe82ed4f98da2766fed2948e Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 6 Mar 2025 18:13:39 +0100 Subject: [PATCH] Lint --- .templates/00-banner.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.templates/00-banner.sh b/.templates/00-banner.sh index 83b7ea81e..fea780fce 100755 --- a/.templates/00-banner.sh +++ b/.templates/00-banner.sh @@ -16,7 +16,8 @@ if ! bashio::supervisor.ping 2>/dev/null; then '-----------------------------------------------------------' # Use environment variables instead of addon options echo "... convert scripts to use environment variables instead of addon options" - for scripts in $(grep -srl "bashio" /etc/cont-init.d /etc/s6-overlay/s6-rc.d /custom-services.d); do + while IFS= read -r scripts + do sed -i -e 's/bashio::config.has_value[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ]/g' \ -e 's/bashio::config.true[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ] \&\& [ "${\1:-}" = "true" ]/g' \ -e 's/\$(bashio::config[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"'])/${\1:-}/g' \ @@ -25,7 +26,7 @@ if ! bashio::supervisor.ping 2>/dev/null; then -e 's/\$(bashio::addon.ingress_port)/""/g' \ -e 's/\$(bashio::addon.ingress_entry)/""/g' \ -e 's/\$(bashio::addon.ip_address)/""/g' "$scripts" - done + done < <(grep -srl "bashio" /etc/cont-init.d /etc/s6-overlay/s6-rc.d /custom-services.d) exit 0 fi