From 5c74195f20e8322095a6a90a4cddbc476ec81b97 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 31 Oct 2006 08:18:58 +0100 Subject: [PATCH] More return value checking fixes --- ccollect.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index aecdbf5..f780091 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -134,9 +134,10 @@ fi if [ -x "$CPREEXEC" ]; then echo "Executing $CPREEXEC ..." "$CPREEXEC" + ret=$? echo "Finished ${CPREEXEC}." - if [ $? -ne 0 ]; then + if [ $ret -ne 0 ]; then echo "$CPREEXEC failed, not starting backup." exit 1 fi @@ -466,9 +467,10 @@ while [ "$i" -lt "$no_sources" ]; do if [ -x "$c_post_exec" ]; then echo "$($DDATE) Executing $c_post_exec ..." "$c_post_exec" + ret=$? echo "$($DDATE) Finished ${c_post_exec}." - if [ $? -ne 0 ]; then + if [ $ret -ne 0 ]; then echo "$c_post_exec failed." fi fi @@ -500,9 +502,10 @@ fi if [ -x "$CPOSTEXEC" ]; then echo "$($DDATE) Executing $CPOSTEXEC ..." "$CPOSTEXEC" + ret=$? echo "$($DDATE) Finished ${CPOSTEXEC}." - if [ $? -ne 0 ]; then + if [ $ret -ne 0 ]; then echo "$CPOSTEXEC failed." fi fi