From 7b9b16eaa2e94fd4970889a82fcdf3ffa53c2c8d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 6 Jul 2025 20:36:25 +0200 Subject: [PATCH] Update 01-config_yaml.sh --- .templates/01-config_yaml.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.templates/01-config_yaml.sh b/.templates/01-config_yaml.sh index 6be190683..15f340a8a 100644 --- a/.templates/01-config_yaml.sh +++ b/.templates/01-config_yaml.sh @@ -1,7 +1,14 @@ -#!/usr/bin/with-contenv bashio +#!/usr/bin/env bashio # shellcheck shell=bash -# shellcheck disable=SC2155,SC1087,SC2163,SC2116,SC2086 -set -e + +################# +# CODE INJECTOR # +################# + +# Any commands written in this bash script will be executed at addon start +# See guide here : https://github.com/alexbelgium/hassio-addons/wiki/Add%E2%80%90ons-feature-:-customisation + +apk add yamllint || apt-get install -y yamllint ################## # INITIALIZATION # @@ -163,8 +170,6 @@ SECRETSFILE="/config/secrets.yaml" if [ -f "$SECRETSFILE" ]; then SECRETSFILE="/homeassistant/secrets.yaml"; fi while IFS= read -r line; do - # Clean output - line="${line//[\"\']/}" # Check if secret if [[ "${line}" == *'!secret '* ]]; then echo "secret detected" @@ -182,7 +187,7 @@ while IFS= read -r line; do # extract keys and values KEYS="${line%%=*}" VALUE="${line#*=}" - line="${KEYS}='${VALUE}'" + line="${KEYS}="${VALUE}" export "$line" # export to python if command -v "python3" &>/dev/null; then