More return value checking fixes

This commit is contained in:
Nico Schottelius 2006-10-31 08:18:58 +01:00
parent e4c63dec6c
commit 5c74195f20

View file

@ -134,9 +134,10 @@ fi
if [ -x "$CPREEXEC" ]; then if [ -x "$CPREEXEC" ]; then
echo "Executing $CPREEXEC ..." echo "Executing $CPREEXEC ..."
"$CPREEXEC" "$CPREEXEC"
ret=$?
echo "Finished ${CPREEXEC}." echo "Finished ${CPREEXEC}."
if [ $? -ne 0 ]; then if [ $ret -ne 0 ]; then
echo "$CPREEXEC failed, not starting backup." echo "$CPREEXEC failed, not starting backup."
exit 1 exit 1
fi fi
@ -466,9 +467,10 @@ while [ "$i" -lt "$no_sources" ]; do
if [ -x "$c_post_exec" ]; then if [ -x "$c_post_exec" ]; then
echo "$($DDATE) Executing $c_post_exec ..." echo "$($DDATE) Executing $c_post_exec ..."
"$c_post_exec" "$c_post_exec"
ret=$?
echo "$($DDATE) Finished ${c_post_exec}." echo "$($DDATE) Finished ${c_post_exec}."
if [ $? -ne 0 ]; then if [ $ret -ne 0 ]; then
echo "$c_post_exec failed." echo "$c_post_exec failed."
fi fi
fi fi
@ -500,9 +502,10 @@ fi
if [ -x "$CPOSTEXEC" ]; then if [ -x "$CPOSTEXEC" ]; then
echo "$($DDATE) Executing $CPOSTEXEC ..." echo "$($DDATE) Executing $CPOSTEXEC ..."
"$CPOSTEXEC" "$CPOSTEXEC"
ret=$?
echo "$($DDATE) Finished ${CPOSTEXEC}." echo "$($DDATE) Finished ${CPOSTEXEC}."
if [ $? -ne 0 ]; then if [ $ret -ne 0 ]; then
echo "$CPOSTEXEC failed." echo "$CPOSTEXEC failed."
fi fi
fi fi