[Logcheck-commits] CVS logcheck/src

CVS User maks-guest logcheck-devel@lists.alioth.debian.org
Tue, 01 Feb 2005 05:54:43 -0700


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

Modified Files:
	logcheck logtail 
Log Message:

* pump up version
* fix invocation of logtail in compat mode regarding no switches
  when invoked.
  thought to do that latter for rewritten logtail (c), 
  but why not yet already in current logtail (Perl).
  works [tm] tested, would be cool to have that for sarge!?


--- /cvsroot/logcheck/logcheck/src/logcheck	2005/01/11 06:18:10	1.102
+++ /cvsroot/logcheck/logcheck/src/logcheck	2005/02/01 12:54:43	1.103
@@ -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.102 2005/01/11 06:18:10 ttroxell Exp $
+# $Id: logcheck,v 1.103 2005/02/01 12:54:43 maks-guest Exp $
 
 if [ $UID == 0 ]; then
     echo "logcheck should not be run as root. Use su to invoke logcheck:"
@@ -52,7 +52,7 @@
 fi
 
 DATE="$(date +'%Y-%m-%d %H:%M')"
-VERSION="1.2.34"
+VERSION="1.2.35"
 
 # Set the default report level
 REPORTLEVEL="server"
--- /cvsroot/logcheck/logcheck/src/logtail	2005/01/11 06:18:10	1.9
+++ /cvsroot/logcheck/logcheck/src/logtail	2005/02/01 12:54:43	1.10
@@ -21,7 +21,7 @@
 
 use strict;
 use warnings;
-my ($size);
+my ($size, $logfile, $offsetfile);
 use Getopt::Std;
 my %opts = ();
 
@@ -29,14 +29,22 @@
 my ($TEST_MODE) = 0;
 getopts("f:o:t", \%opts);
 
-if (! $opts{f}) {
-   print STDERR "No logfile to read. Use -f switch.\n";
+# try to detect plain logtail invocation without switches
+if (!$opts{f} && $#ARGV != 0 && $#ARGV != 1) {
+   print STDERR "No logfile to read. Use -f [LOGFILE].\n";
    exit 66;
-} elsif ($opts{t}) {
+} elsif ($#ARGV == 0) {
+   $logfile = $ARGV[0];
+} elsif ($#ARGV == 1) {
+   ($logfile, $offsetfile) = ($ARGV[0], $ARGV[1]);
+} else {
+   ($logfile, $offsetfile) = ($opts{f}, $opts{o});
+}
+
+if ($opts{t}) {
     $TEST_MODE = 1;
 }
 
-my ($logfile, $offsetfile) = ($opts{f}, $opts{o});
 
 if (! -f $logfile) {
     print STDERR "File $logfile cannot be read.\n";