Fix: source cont-init.d scripts instead of bash to inherit bashio functions

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/88474b87-22ad-4e13-9d5c-8567d0b4098f

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-02 12:08:30 +00:00
committed by GitHub
parent 6fc22476e8
commit 24d0670843

View File

@@ -18,8 +18,10 @@ if [ -d /etc/cont-init.d ]; then
for script in /etc/cont-init.d/*.sh; do
[ -f "$script" ] || continue
echo "[Maintainerr] Running init script: $script"
# Use bash directly (no S6 with-contenv available)
bash "$script"
# Source the script so it inherits bashio functions from bashio-standalone.
# Using bash "$script" would spawn a new process without bashio:: functions,
# causing "command not found" failures under set -e.
source "$script"
done
fi