[Logcheck-commits] CVS logcheck/src

CVS User ttroxell logcheck-devel@lists.alioth.debian.org
Sat, 15 May 2004 02:28:21 -0600


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

Modified Files:
	logcheck logtail 
Log Message:
Many error checks, indicated future checks with comments.

I believe that I have all of the disk writing commands either checking or commented
nearby at this point.

I'm still thinking about the best way to handle egrep and logtail ret vals.



--- /cvsroot/logcheck/logcheck/src/logcheck	2004/05/14 10:55:47	1.23
+++ /cvsroot/logcheck/logcheck/src/logcheck	2004/05/15 08:28:21	1.24
@@ -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.23 2004/05/14 10:55:47 maks-guest Exp $
+# $Id: logcheck,v 1.24 2004/05/15 08:28:21 ttroxell Exp $
 
 
 # Set the umask
@@ -129,6 +129,10 @@
     if [ $MAILOUT -eq 0 ]; then
 	{
 	    cat<<EOF
+Warning:  If you are seeing this message, you log files may not have
+been checked!
+
+Further detail:
 $message
 
 Check temporary directory: $TMPDIR
@@ -144,7 +148,8 @@
  # Add an identification line at the beginning of the sent mail
 setintro() {
     if [ -f /etc/logcheck/header.txt ] ; then
-       $CAT /etc/logcheck/header.txt >> $TMPDIR/report
+       $CAT /etc/logcheck/header.txt >> $TMPDIR/report \
+           || error "Could not append header to $TMPDIR/report  Disk full?"
     fi
 }
 
@@ -152,7 +157,8 @@
 # Add a footer to the report.
 setfooter() {
     if [ -f /etc/logcheck/footer.txt ] ; then
-       $CAT /etc/logcheck/footer.txt >> $TMPDIR/report
+       $CAT /etc/logcheck/footer.txt >> $TMPDIR/report \
+           || error "Could not append footer to $TMPDIR/report Disk full?"
     fi
 }
 
@@ -165,12 +171,13 @@
 
     if [ -d $dir ]; then 
 	mkdir -p $cleaned \
-	    || error "Could not make dir for cleaned rulefiles"
+	    || error "Could not make dir $cleaned for cleaned rulefiles."
 	for rulefile in $(run-parts --list $dir); do
 	    rulefile=$(basename $rulefile)

[167 lines skipped]
--- /cvsroot/logcheck/logcheck/src/logtail	2004/05/14 10:55:47	1.4
+++ /cvsroot/logcheck/logcheck/src/logtail	2004/05/15 08:28:21	1.5
@@ -20,6 +20,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 use strict;
+use warnings;
 my ($size);
 use Getopt::Std;
 my %opts = ();