mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-06 07:35:56 +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.
|
# 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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user