From 2c6611da27f251f351543aea8709ee3edbdde85f Mon Sep 17 00:00:00 2001 From: EricClaeys <83164203+EricClaeys@users.noreply.github.com> Date: Tue, 28 Dec 2021 01:13:01 -0600 Subject: [PATCH] generateForDay.sh: bug fix $EXIT_CODE Fix calculation of $EXIT_CODE so it's never negative --- scripts/generateForDay.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/generateForDay.sh b/scripts/generateForDay.sh index 404d66fb8..82a455348 100755 --- a/scripts/generateForDay.sh +++ b/scripts/generateForDay.sh @@ -180,11 +180,10 @@ if [ "${DO_KEOGRAM}" = "true" ] ; then if [ "${TYPE}" = "GENERATE" ]; then CMD="'${ALLSKY_HOME}/keogram' ${SIZE_FILTER} -d '${DATE_DIR}' -e ${EXTENSION} -o '${UPLOAD_FILE}' ${KEOGRAM_EXTRA_PARAMETERS}" generate "Keogram" "keogram" "${CMD}" - let EXIT_CODE=${EXIT_CODE}+${?} else upload "Keogram" "${UPLOAD_FILE}" "${KEOGRAM_DIR}" "${KEOGRAM_FILE}" "${KEOGRAM_DESTINATION_NAME}" "${WEB_KEOGRAM_DIR}" - let EXIT_CODE=${EXIT_CODE}+${?} fi + [ $? -ne 0 ] && let EXIT_CODE=${EXIT_CODE}+1 fi if [ "${DO_STARTRAILS}" = "true" ] ; then @@ -193,11 +192,10 @@ if [ "${DO_STARTRAILS}" = "true" ] ; then if [ "${TYPE}" = "GENERATE" ]; then CMD="'${ALLSKY_HOME}/startrails' ${SIZE_FILTER} -d '${DATE_DIR}' -e ${EXTENSION} -b ${BRIGHTNESS_THRESHOLD} -o '${UPLOAD_FILE}' ${STARTRAILS_EXTRA_PARAMETERS}" generate "Startrails, threshold=${BRIGHTNESS_THRESHOLD}" "startrails" "${CMD}" - let EXIT_CODE=${EXIT_CODE}+${?} else upload "Startrails" "${UPLOAD_FILE}" "${STARTRAILS_DIR}" "${STARTRAILS_FILE}" "${STARTRAILS_DESTINATION_NAME}" "${WEB_STARTRAILS_DIR}" - let EXIT_CODE=${EXIT_CODE}+${?} fi + [ $? -ne 0 ] && let EXIT_CODE=${EXIT_CODE}+1 fi if [ "${DO_TIMELAPSE}" = "true" ] ; then @@ -206,11 +204,10 @@ if [ "${DO_TIMELAPSE}" = "true" ] ; then if [ "${TYPE}" = "GENERATE" ]; then CMD="'${ALLSKY_SCRIPTS}/timelapse.sh' ${DATE}" generate "Timelapse" "" "${CMD}" # it creates the necessary directory - let EXIT_CODE=${EXIT_CODE}+${?} else upload "Timelapse" "${UPLOAD_FILE}" "${VIDEOS_DIR}" "${VIDEOS_FILE}" "${VIDEOS_DESTINATION_NAME}" "${WEB_VIDEOS_DIR}" - let EXIT_CODE=${EXIT_CODE}+${?} fi + [ $? -ne 0 ] && let EXIT_CODE=${EXIT_CODE}+1 fi