]> arthur.barton.de Git - backup-script.git/commitdiff
backup-script-wrapper: Return exit code of backup-script
authorAlexander Barton <alex@barton.de>
Tue, 18 Aug 2015 08:46:21 +0000 (10:46 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 18 Aug 2015 08:46:21 +0000 (10:46 +0200)
bin/backup-script-wrapper

index f877a5b912b7c5c882c1ddd50e109717d6c9b840..fbd061f6c919b37e7ae162defdb5202e4d7b91c1 100755 (executable)
@@ -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-