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 $?"