ccollect now exits, when the pre-executing program terminated anormally.

This commit is contained in:
Nico Schottelius 2006-03-19 00:59:42 +01:00
parent 465f691f60
commit 7951c72189

View file

@ -14,8 +14,8 @@ CPREEXEC="$CDEFAULTS/pre_exec"
CPOSTEXEC="$CDEFAULTS/post_exec" CPOSTEXEC="$CDEFAULTS/post_exec"
TMP=$(mktemp /tmp/$(basename $0).XXXXXX) TMP=$(mktemp /tmp/$(basename $0).XXXXXX)
VERSION=0.3.3 VERSION=0.4
RELEASE="2006-02-24" RELEASE="2006-XX-XX"
HALF_VERSION="ccollect $VERSION" HALF_VERSION="ccollect $VERSION"
FULL_VERSION="ccollect $VERSION ($RELEASE)" FULL_VERSION="ccollect $VERSION ($RELEASE)"
@ -154,7 +154,7 @@ fi
# #
D_FILE_INTERVALL="$CDEFAULTS/intervalls/$INTERVALL" D_FILE_INTERVALL="$CDEFAULTS/intervalls/$INTERVALL"
D_INTERVALL=$(cat $D_FILE_INTERVALL 2>/dev/null) D_INTERVALL=$(cat "$D_FILE_INTERVALL" 2>/dev/null)
# #
# Look for pre-exec command (general) # Look for pre-exec command (general)
@ -163,6 +163,11 @@ if [ -x "$CPREEXEC" ]; then
echo "Executing $CPREEXEC ..." echo "Executing $CPREEXEC ..."
"$CPREEXEC" "$CPREEXEC"
echo "Finished ${CPREEXEC}." echo "Finished ${CPREEXEC}."
if [ $? -ne 0 ]; then
echo "$CPREEXEC failed, aborting backup."
exit 1
fi
fi fi
# #