Modify entrypoint to improve script execution

Updated init script execution to use exec and added bashio shebang.
This commit is contained in:
Alexandre
2026-04-03 09:01:09 +02:00
committed by GitHub
parent d8aa25cd5d
commit 4490320c53

View File

@@ -7,19 +7,13 @@ set -e
# Runs cont-init.d scripts then drops privileges and starts the app. # Runs cont-init.d scripts then drops privileges and starts the app.
############################################################################### ###############################################################################
# ─── Source standalone bashio if available ───────────────────────────────────
if [ -f /usr/local/lib/bashio-standalone.sh ]; then
# shellcheck disable=SC1091
source /usr/local/lib/bashio-standalone.sh
fi
# ─── Run cont-init.d scripts ───────────────────────────────────────────────── # ─── Run cont-init.d scripts ─────────────────────────────────────────────────
if [ -d /etc/cont-init.d ]; then if [ -d /etc/cont-init.d ]; then
for script in /etc/cont-init.d/*.sh; do for script in /etc/cont-init.d/*.sh; do
[ -f "$script" ] || continue [ -f "$script" ] || continue
sed -i "1a\#!/usr/bin/env bashio" "$script"
echo "[Maintainerr] Running init script: $script" echo "[Maintainerr] Running init script: $script"
# Use bash directly (no S6 with-contenv available) exec "$script"
bash "$script"
done done
fi fi