From e2f386b67b719baa43030aac7f11a3baa88f6e3e Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 15 Feb 2025 11:47:05 +0100 Subject: [PATCH] Restore entrypoint --- .templates/ha_entrypoint.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.templates/ha_entrypoint.sh b/.templates/ha_entrypoint.sh index cbd7d1544..99c38f02e 100755 --- a/.templates/ha_entrypoint.sh +++ b/.templates/ha_entrypoint.sh @@ -40,9 +40,9 @@ for SCRIPTS in /etc/cont-init.d/*; do sed -i "s/(.*\s|^)exit ([0-9]+)/\1 return \2 || exit \2/g" "$SCRIPTS" sed -i "s/bashio::exit.nok/return 1/g" "$SCRIPTS" sed -i "s/bashio::exit.ok/return 0/g" "$SCRIPTS" - source "$SCRIPTS" || { echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"; exit $?; } + source "$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?" else - "$SCRIPTS" || { echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"; exit $?; } + "$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?" fi # Cleanup @@ -83,10 +83,8 @@ if [ "$$" -eq 1 ]; then echo "All subprocesses terminated. Exiting." exit 0 } - trap terminate SIGTERM - while :; do - sleep 1 - done + trap terminate SIGTERM SIGINT + while :; do sleep infinity & wait $!; done else echo " " echo -e "\033[0;32mStarting the upstream container\033[0m"