mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-04-06 06:06:23 +02:00
Modify entrypoint to improve script execution
Updated init script execution to use exec and added bashio shebang.
This commit is contained in:
@@ -7,19 +7,13 @@ set -e
|
||||
# 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 ─────────────────────────────────────────────────
|
||||
if [ -d /etc/cont-init.d ]; then
|
||||
for script in /etc/cont-init.d/*.sh; do
|
||||
[ -f "$script" ] || continue
|
||||
sed -i "1a\#!/usr/bin/env bashio" "$script"
|
||||
echo "[Maintainerr] Running init script: $script"
|
||||
# Use bash directly (no S6 with-contenv available)
|
||||
bash "$script"
|
||||
exec "$script"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user