[Logcheck-commits] CVS logcheck/src
CVS User ttroxell
logcheck-devel@lists.alioth.debian.org
Thu, 24 Mar 2005 01:32:17 +0000
Update of /cvsroot/logcheck/logcheck/src
In directory haydn:/tmp/cvs-serv32563/src
Modified Files:
logcheck
Log Message:
This is quite hackish, but it is effective in warning about invalid
rules. Thanks to Jamie for the initial code here.
Also, updated copyright dates.
--- /cvsroot/logcheck/logcheck/src/logcheck 2005/03/23 16:27:12 1.107
+++ /cvsroot/logcheck/logcheck/src/logcheck 2005/03/24 01:32:16 1.108
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2004 Debian Logcheck Team
+# Copyright (C) 2004-2005 Debian Logcheck Team
# <logcheck-devel@alioth.lists.debian.org>
# Copyright (C) 2002,2003 Jonathan Middleton <jjm@ixtab.org.uk>
# Copyright (C) 1999-2002 Rene Mayrhofer <rmayr@debian.org>
@@ -22,7 +22,7 @@
# along with Logcheck; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# $Id: logcheck,v 1.107 2005/03/23 16:27:12 maks-guest Exp $
+# $Id: logcheck,v 1.108 2005/03/24 01:32:16 ttroxell Exp $
if [ $UID == 0 ]; then
echo "logcheck should not be run as root. Use su to invoke logcheck:"
@@ -123,6 +123,8 @@
echo "$message" >> $TMPDIR/warnings \
|| error "Could not append to $TMPDIR/warnings."
fi
+ echo
+ return 0
}
# Mail error message to sysadmin
@@ -377,9 +379,10 @@
debug "cleanchecked - dir - $clean"
for file in $(ls -1 $clean/); do
debug "cleanchecked - dir - $clean/$file"
- egrep --text -v -f $clean/$file $TMPDIR/checked | cat \
- >> $TMPDIR/checked.1 \
- || error "Could not output to TMPDIR/checked.1 Disk Full?"
+ (egrep --text -v -f $clean/$file $TMPDIR/checked \
+ || warn "Could not process file $file") | cat \
+ >> $TMPDIR/checked.1 \
+ || error "Could not output to $TMPDIR/checked.1 Disk Full?"
mv $TMPDIR/checked.1 $TMPDIR/checked \
|| error "Could not move $TMPDIR/checked.1 to $TMPDIR/checked"
done
@@ -663,14 +666,6 @@
debug "Not setting the Intro"
fi
-# Add warnings to report
-if [ -f $TMPDIR/warnings ]; then
- printheader "Logcheck Warnings" >> $TMPDIR/report \
- || error "Cannot append warnings to report. Disk Full?"
[22 lines skipped]