From: Alexander Barton Date: Tue, 18 Aug 2015 08:46:21 +0000 (+0200) Subject: backup-script-wrapper: Return exit code of backup-script X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=86140da3b0194043373d049da47f7d4808776c50;p=backup-script.git backup-script-wrapper: Return exit code of backup-script --- diff --git a/bin/backup-script-wrapper b/bin/backup-script-wrapper index f877a5b..fbd061f 100755 --- a/bin/backup-script-wrapper +++ b/bin/backup-script-wrapper @@ -38,13 +38,16 @@ echo if [ -w "$LOGFILE" ]; then "$(dirname "$0")/backup-script" "$@" | tee -a "$LOGFILE" + r=${PIPESTATUS[0]} else "$(dirname "$0")/backup-script" "$@" + r=$? echo "(Can't write logfile: \"$LOGFILE\"!)" fi cat "$TMP" | mail -s "$HOST: $NAME results" "$MAILTO" rm -f "$TMP" +exit $r # -eof-