From 29f59b407789c7957a4459beb927a7dabaf07f6d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:17:30 +0100 Subject: [PATCH] Allow source --- .templates/ha_entrypoint.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.templates/ha_entrypoint.sh b/.templates/ha_entrypoint.sh index e2b4c39ea..1f1065b49 100755 --- a/.templates/ha_entrypoint.sh +++ b/.templates/ha_entrypoint.sh @@ -31,6 +31,16 @@ for SCRIPTS in /etc/cont-init.d/*; do sed -i "s|$currentshebang|$shebang|g" "$SCRIPTS" fi + # Start the script + if [ "${ha_entry_source:-null}" = true ]; then + # Use source to share env variables + # shellcheck source=/dev/null + source "$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?" + else + # Support for posix only shell + /."$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?" + fi + # Start the script /."$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"