[Logcheck-commits] CVS logcheck/src

CVS User ttroxell logcheck-devel@lists.alioth.debian.org
Thu, 20 May 2004 02:09:11 -0600


Update of /cvsroot/logcheck/logcheck/src
In directory haydn:/tmp/cvs-serv10095

Modified Files:
	logcheck 
Log Message:
enable egrep checks


--- /cvsroot/logcheck/logcheck/src/logcheck	2004/05/19 11:15:21	1.35
+++ /cvsroot/logcheck/logcheck/src/logcheck	2004/05/20 08:09:10	1.36
@@ -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.35 2004/05/19 11:15:21 maks-guest Exp $
+# $Id: logcheck,v 1.36 2004/05/20 08:09:10 ttroxell Exp $
 
 
 # Set the umask
@@ -176,8 +176,9 @@
 	    rulefile=$(basename $rulefile)
 	    if [ -f ${dir}/${rulefile} ]; then
 		debug "cleanrules: ${dir}/${rulefile}"
-		egrep --text -v '^\s*$|^#' $dir/$rulefile >> $cleaned/$rulefile
-#		    || error "Could not append to $cleaned/$rulefile.  Disk Full?"
+		# pipe to cat on greps to get usable exit status
+		egrep --text -v '^\s*$|^#' $dir/$rulefile |cat>> $cleaned/$rulefile \
+		    || error "Could not append to $cleaned/$rulefile.  Disk Full?"
 	    fi
 	done
     elif [ -f $dir ]; then
@@ -195,8 +196,8 @@
 	if [ $SYSLOGSUMMARY -eq 1 ] && [ -x $SYSLOG_SUMMARY ]; then
 	    debug "report: running syslog-summary - $*"
 	    $SYSLOG_SUMMARY $TMPDIR/checked | \
-		egrep -v "^Summarizing " >> $TMPDIR/report 
-#		|| "Could not append to report.  Disk Full?"
+		egrep -v "^Summarizing "|cat >> $TMPDIR/report \
+		    || error "Could not append to report.  Disk Full?"
 	else
 	    if [ $SYSLOGSUMMARY -eq 1 ] && [ ! -x $SYSLOG_SUMMARY ]; then
 	    	debug "report : WARNING : can't exec $SYSLOG_SUMMARY. Running without summary"
@@ -271,7 +272,6 @@
 	if [ ! -f $TMPDIR/checked ]; then
 	    error "Could not output to $TMPDIR/checked.  Disk Full?"
 	fi
-#	    || error "Could not output to $TMPDIR/checked.  Disk Full?"
 
 	if [ -s $TMPDIR/checked ]; then
 	    debug "greplogoutput: Entries in checked"
@@ -292,11 +292,11 @@
 		# Remove any  entries already reported
 		for file in $(ls $raise/ | grep -v logcheck) ; do
 		    debug "Cleaning logcheck: $file"
-		    egrep --text -v -f $raise/$file $TMPDIR/checked \
-			>> $TMPDIR/checked.1 
-#			|| error "Could not output to $TMPDIR/checked.1"
+		    egrep --text -v -f $raise/$file $TMPDIR/checked |cat \

[78 lines skipped]