mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-04-06 06:06:23 +02:00
fix(maintainerr): fix broken init script execution causing ingress 404
The entrypoint used `bashio "$script"` to run init scripts, but bashio CLI
is a function dispatcher (bashio::"${@}"), not a script interpreter. This
meant 32-nginx_ingress.sh never executed, leaving nginx config with
unsubstituted %%port%%/%%interface%%/%%ingress_entry%% placeholders, so
nginx failed to start and ingress returned 404.
Fix: source the bashio library first, then run each init script via
`source` in a subshell so bashio:: functions are inherited.
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/d5bff0a8-62ba-4564-a4fc-74c87d8b0d55
Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
15798c19d2
commit
464c7362d8
@@ -7,13 +7,23 @@ set -e
|
||||
# Runs cont-init.d scripts then drops privileges and starts the app.
|
||||
###############################################################################
|
||||
|
||||
# ─── Source bashio library so init scripts can use bashio:: functions ─────────
|
||||
for _f in /usr/lib/bashio/bashio /usr/lib/bashio/bashio.sh; do
|
||||
if [ -f "$_f" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
source "$_f"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# ─── Run cont-init.d scripts ─────────────────────────────────────────────────
|
||||
if [ -d /etc/cont-init.d ]; then
|
||||
for script in /etc/cont-init.d/*.sh; do
|
||||
[ -f "$script" ] || continue
|
||||
sed -i '1s|.*|#!/usr/bin/env bashio|' "$script"
|
||||
echo "[Maintainerr] Running init script: $script"
|
||||
bashio "$script"
|
||||
# Run in subshell to isolate side effects; bashio functions are inherited
|
||||
# shellcheck disable=SC1090
|
||||
( source "$script" )
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user