Ensure proper exit code handling in script termination

This commit is contained in:
Evgeniy Antonyuk 2024-06-20 20:27:37 +03:00
parent 1c3907df34
commit 58867e72a8

View File

@ -156,27 +156,27 @@ fi
if [ "$DOCKER" == "true" ]; then if [ "$DOCKER" == "true" ]; then
if [ "$LOCAL_SCRIPTS" == "true" ]; then if [ "$LOCAL_SCRIPTS" == "true" ]; then
bash install-Docker.sh ${PARAMETERS} bash install-Docker.sh ${PARAMETERS} || EXIT_CODE=$?
else else
curl -s -O ${DOWNLOAD_URL_PREFIX}/install-Docker.sh curl -s -O ${DOWNLOAD_URL_PREFIX}/install-Docker.sh
bash install-Docker.sh ${PARAMETERS} bash install-Docker.sh ${PARAMETERS} || EXIT_CODE=$?
rm install-Docker.sh rm install-Docker.sh
fi fi
else else
if [ -f /etc/redhat-release ] ; then if [ -f /etc/redhat-release ] ; then
if [ "$LOCAL_SCRIPTS" == "true" ]; then if [ "$LOCAL_SCRIPTS" == "true" ]; then
bash install-RedHat.sh ${PARAMETERS} bash install-RedHat.sh ${PARAMETERS} || EXIT_CODE=$?
else else
curl -s -O ${DOWNLOAD_URL_PREFIX}/install-RedHat.sh curl -s -O ${DOWNLOAD_URL_PREFIX}/install-RedHat.sh
bash install-RedHat.sh ${PARAMETERS} bash install-RedHat.sh ${PARAMETERS} || EXIT_CODE=$?
rm install-RedHat.sh rm install-RedHat.sh
fi fi
elif [ -f /etc/debian_version ] ; then elif [ -f /etc/debian_version ] ; then
if [ "$LOCAL_SCRIPTS" == "true" ]; then if [ "$LOCAL_SCRIPTS" == "true" ]; then
bash install-Debian.sh ${PARAMETERS} bash install-Debian.sh ${PARAMETERS} || EXIT_CODE=$?
else else
curl -s -O ${DOWNLOAD_URL_PREFIX}/install-Debian.sh curl -s -O ${DOWNLOAD_URL_PREFIX}/install-Debian.sh
bash install-Debian.sh ${PARAMETERS} bash install-Debian.sh ${PARAMETERS} || EXIT_CODE=$?
rm install-Debian.sh rm install-Debian.sh
fi fi
else else
@ -184,3 +184,5 @@ else
exit 1; exit 1;
fi fi
fi fi
exit ${EXIT_CODE:-0}