From 9d699a27ef70449b75986b81793c15bb2c0886d8 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Wed, 23 Aug 2023 13:56:58 -0500 Subject: [PATCH] Fix status checking for pipes. --- kvm-backup-images.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kvm-backup-images.sh b/kvm-backup-images.sh index bb28665..cf7c5cc 100644 --- a/kvm-backup-images.sh +++ b/kvm-backup-images.sh @@ -108,7 +108,7 @@ while read -r line; do IMAGES+=("$IMAGE") done < <( virsh domblklist $DOMAIN | tail -n +3 - echo $? >$BLKLIST_STATUS_TMP + echo ${PIPESTATUS[0]} >$BLKLIST_STATUS_TMP ) # Get status from the block listing. @@ -222,7 +222,7 @@ while read -r line; do fi done < <( virsh list --all | tail -n +3 - echo $? >$DOMLIST_STATUS_TMP + echo ${PIPESTATUS[0]} >$DOMLIST_STATUS_TMP ) # Get status from the domain listing.