Use subshells

This commit is contained in:
Alexandre
2024-12-05 10:34:10 +01:00
committed by GitHub
parent a0c7bd046e
commit c2c0ea9361

View File

@@ -58,10 +58,10 @@ for SCRIPTS in /etc/cont-init.d/*; do
sed -i "s/bashio::exit.nok/return 1/g" "$SCRIPTS"
sed -i "s/bashio::exit.ok/return 0/g" "$SCRIPTS"
# shellcheck source=/dev/null
source "$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"
(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 $?"
("$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $? &)
fi
# Cleanup