Git Repository Public Repository

logcheck

URLs

Copy to Clipboard

Diff Revisions 65d0d4 ... vs f14b4c ... for //logcheck.pl

Diff revisions: vs.
  @@ -1,5 +1,21 @@
1 1 #!/usr/bin/perl
2 2
3 + # Logchecker - perl script to check unix logfiles and notify by email
4 + # if entries appear not covered by the whitelist
5 + # Copyright (C) long time ago by Peter, peters-webcorner.de
6 + #
7 + # This program is free software: you can redistribute it and/or modify
8 + # it under the terms of the GNU General Public License as published by
9 + # the Free Software Foundation, either version 3 of the License, or
10 + # (at your option) any later version.
11 + #
12 + # This program is distributed in the hope that it will be useful,
13 + # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 + # GNU General Public License for more details.
16 + #
17 + # You should have received a copy of the GNU General Public License
18 + # along with this program. If not, see <https://www.gnu.org/licenses/>.
3 19
4 20 require 'logcheck.conf';
5 21 $mode="run";
  @@ -8,21 +24,34 @@
8 24 sub head() {
9 25 print "\n";
10 26 print "-----------------------------\n";
11 - print "This is logcheck.pl V1.0.3\n";
12 - print "http://peters-webcorner.de\n";
13 - print "project hosted on origo\n";
14 - print "http://logcheck.origo.ethz.ch\n";
27 + print "This is logcheck.pl V1.0.4\n";
28 + print "https://peters-webcorner.de\n";
29 + print "project hosted on github\n";
30 + print "https://github.com/pstimpel/logcheck\n\n";
31 + print "Logchecker - Copyright (C) long time ago by Peter\n";
32 + print "This program comes with ABSOLUTELY NO WARRANTY; for details run `-l'.\n";
33 + print "This is free software, and you are welcome to redistribute it\n";
34 + print "under certain conditions. Check license for details.\n";
15 35 print "-----------------------------\n\n";
16 36 }
17 37
18 - if (($ARGV[0] ne "") && ($ARGV[0] ne "debug")) {
38 + if (($ARGV[0] ne "") && ($ARGV[0] ne "debug") && ($ARGV[0] ne "-l")) {
19 39 head();
20 - print "you can use 'logcheck.pl debug' or 'logcheck.pl' without any parameters\n";
21 - print "hint: using debug will prevent script from sending mail...\n";
40 + print "Parameters:\n";
41 + print "logcheck.pl normal run, parse logfiles and fire email if needed\n";
42 + print "logcheck.pl debug prevents script from sending mail\n";
43 + print "logcheck.pl -l prints license to console\n";
22 44 exit 0;
23 45
24 46 }
25 47
48 + if ($ARGV[0] eq "-l") {
49 + head();
50 + print "Content of license\n\n\n";
51 + system('cat LICENSE | more');
52 + exit 0;
53 + }
54 +
26 55 if ($ARGV[0] eq "debug") {
27 56 head();
28 57 print "debug mode on...\n";