From 1b4affeade2f5653efc23202284098f0eb579487 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:19:41 +0100 Subject: [PATCH] Convert bashio commands --- .templates/00-banner.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.templates/00-banner.sh b/.templates/00-banner.sh index 2cc62c3a4..9b528a030 100755 --- a/.templates/00-banner.sh +++ b/.templates/00-banner.sh @@ -15,7 +15,13 @@ 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" - sed -i -e 's/bashio::config.has_value[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z \${\1+x} ]/g' -e 's/bashio::config[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/\${\1}/g' /etc/cont-init.d/* + for scripts in /etc/cont-init.d/*; do + sed -i -e 's/bashio::config.has_value[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z \${\1+x} ]/g' \ + -e 's/bashio::config[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/\${\1}/g' \ + -e 's/bashio::addon.port[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/\${\1}/g' \ + -e 's/bashio::services[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/\${\1}/g' \ + -e 's/bashio::addon.ip_address/\${IP_ADDRESS}/g' "$scripts" || true + done # Fake options.json echo "... create empty /data/options.json for bashio compatibility" mkdir -p /data