Return non-zero exit code if any command in pipe fails
[zfs-ubuntu/.git] / zfs-restore
index 4014ff74598a277f04e330f79757364ccf3fda69..d5ca2e6caeb9e079d1562e217fa3199b617f09fc 100755 (executable)
@@ -16,6 +16,9 @@ dst_pool=$3
 dst_fs=$4
 dst_hostname=$5
 
+# return non-zero exit code if any command in the pipe fails
+set -o pipefail
+
 if [[ -z "$SCRIPT_UNDER_TEST" ]]; then
     exec >> $logdir/zfs-restore.log 2>&1
 fi