From 80f42faeea1be6ce0dc299cdfdc211796a054ae4 Mon Sep 17 00:00:00 2001 From: Nick Mahoney Date: Thu, 20 Feb 2020 13:02:58 -0800 Subject: [PATCH] archive.sh should have non-zero exit code on rsync failures --- archive.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/archive.sh b/archive.sh index 8ce2a88..2387ef1 100755 --- a/archive.sh +++ b/archive.sh @@ -235,6 +235,8 @@ iso_rsync() { main() { # more verbose when launched from a tty [[ -t 1 && -n "$DEBUG" ]] && set -x + + local EXIT_CODE=0 load_config @@ -262,13 +264,16 @@ main() { # last pointing to an empty repo. (( $REPO_DAYLY )) && repo_daily (( $REPO_PACKAGES )) && repo_packages + else + EXIT_CODE=1 fi fi (( $ARCHIVE_ISO )) && iso_rsync + EXIT_CODE=$(( $EXIT_CODE + $? )) - return 0 + return $EXIT_CODE } main "$@"