There was a error in my patch - the field seperator for the sorts should
have been "/" instead of ":". Attached is the complete
/etc/cron.daily/integrit that I am currently using.
--
Erik Rossen OpenPGP key: 2935D0B9
[EMAIL PROTECTED] On fonce la tĂȘte dans
http://www.rtfm-sarl.ch le guidon et on RTFM.
#!/bin/sh
# /etc/cron.daily/integrit : integrit daily cron job
# initially written by Andras Bali
test -x /usr/sbin/integrit || exit 0
test -f /etc/integrit/integrit.debian.conf || exit 0
CONFIGS=""
. /etc/integrit/integrit.debian.conf
test -n "$CONFIGS" || exit 0
if test -z "$EMAIL_RCPT"; then
echo "EMAIL_RCPT must be set in /etc/integrit/integrit.debian.conf" >&2
exit 1
fi
REPORT="/var/lib/integrit/current.report.$$"
cp /dev/null "$REPORT"
trap "rm -f \"$REPORT\"" EXIT
rc=0
for i in $CONFIGS; do
known=`sed -n 's/^ *known *= *\(.\+\) *$/\1/p' <$i |head -1`
current=`sed -n 's/^ *current *= *\(.\+\) *$/\1/p' <$i |head -1`
if test -z "$known" -o -z "$current"; then
echo "known and/or current not set in $i, skipping." >&2; echo
continue
fi
OPTS='-cu'
test -e "$known" || OPTS='-u'
echo "start: integrit -C $i $OPTS"
RC=0
nice integrit -C $i "$OPTS" 2>&1 || RC="$?"
echo "exit: $RC"; echo
if test "$RC" -eq 0; then
test -e "$known" || cp "$current" "$known"
else
rc="$RC"
fi
test "AUTO_UPDATE" = "no" || cp "$current" "$known"
done >>"$REPORT"
LC_COLLATE=C ed -s "$REPORT" 1>/dev/null <<EOF
1
/do update/+1
.,/^integrit:/-1 w ! sort -t/ -k2 > "%.changes"
.,/^integrit:/-1 d
-1
. r ! cat "%.changes"
! rm -f "%.changes"
w
/integrit: checking for missing files/+1
.,/^integrit:/-1 w ! sort -t/ -k2 > "%.missing"
.,/^integrit:/-1 d
-1
. r ! cat "%.missing"
! rm -f "%.missing"
wq
EOF
if test "$rc" -ne 0 -o "$ALWAYS_EMAIL" = 'true'; then
mail -s "$EMAIL_SUBJ" "$EMAIL_RCPT" <"$REPORT"
fi