1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
--- scripts/logwatch.pl.orig 2025-07-21 23:56:15 UTC
+++ scripts/logwatch.pl
@@ -106,20 +106,20 @@ $Config{'appendcwdtologdirs'} = 0;
$Config{'appendvarlogtologdirs'} = 1;
$Config{'appendcwdtologdirs'} = 0;
-if (-e "$ConfigDir/conf/html/header.html") {
- $Config{'html_header'} = "$ConfigDir/conf/html/header.html";
-} elsif (-e "$BaseDir/dist.conf/html/header.html") {
- $Config{'html_header'} = "$BaseDir/dist.conf/html/header.html";
+if (-e "$ConfigDir/html/header.html") {
+ $Config{'html_header'} = "$ConfigDir/html/header.html";
+} elsif (-e "$ConfigDir/defaults/html/header.html") {
+ $Config{'html_header'} = "$ConfigDir/defaults/html/header.html";
} else {
- $Config{'html_header'} = "$BaseDir/default.conf/html/header.html";
+ $Config{'html_header'} = "$ConfigDir/defaults/html/header.html";
}
-if (-e "$ConfigDir/conf/html/footer.html") {
- $Config{'html_footer'} = "$ConfigDir/conf/html/footer.html";
-} elsif (-e "$BaseDir/dist.conf/html/footer.html") {
- $Config{'html_footer'} = "$BaseDir/dist.conf/html/footer.html";
+if (-e "$ConfigDir/html/footer.html") {
+ $Config{'html_footer'} = "$ConfigDir/html/footer.html";
+} elsif (-e "$ConfigDir/defaults/html/footer.html") {
+ $Config{'html_footer'} = "$ConfigDir/defaults/html/footer.html";
} else {
- $Config{'html_footer'} = "$BaseDir/default.conf/html/footer.html";
+ $Config{'html_footer'} = "$ConfigDir/defaults/html/footer.html";
}
#Added to create switches for different os options -mgt
@@ -157,10 +157,10 @@ if ($Config{'debug'} > 8) {
@ReadConfigNames = ();
@ReadConfigValues = ();
-&ReadConfigFile ("$BaseDir/default.conf/logwatch.conf", "");
-&ReadConfigFile ("$BaseDir/dist.conf/logwatch.conf", "");
-&ReadConfigFile ("$ConfigDir/conf/logwatch.conf", "");
-&ReadConfigFile ("$ConfigDir/conf/override.conf", "logwatch");
+&ReadConfigFile ("$ConfigDir/defaults/logwatch.conf", "");
+&ReadConfigFile ("$ConfigDir/defaults/logwatch.conf", "");
+&ReadConfigFile ("$ConfigDir/logwatch.conf", "");
+&ReadConfigFile ("$ConfigDir/override.conf", "logwatch");
for (my $i = 0; $i <= $#ReadConfigNames; $i++) {
@@ -350,7 +350,7 @@ my (@CmdList, @CmdArgList, @Separators, $ThisFile, $co
my (@CmdList, @CmdArgList, @Separators, $ThisFile, $count);
-foreach my $ServicesDir ("$BaseDir/default.conf", "$BaseDir/dist.conf", "$ConfigDir/conf") {
+foreach my $ServicesDir ("$ConfigDir/defaults", "$ConfigDir/defaults", "$ConfigDir") {
if (-d "$ServicesDir/services") {
opendir(SERVICESDIR, "$ServicesDir/services") or
die "$ServicesDir $!";
@@ -374,13 +374,13 @@ foreach my $f (@services) {
@ReadConfigValues = ();
@Separators = ();
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$BaseDir/default.conf/services/$f", "");
+ &ReadConfigFile("$ConfigDir/defaults/services/$f", "");
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$BaseDir/dist.conf/services/$f", "");
+ &ReadConfigFile("$ConfigDir/defaults/services/$f", "");
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$ConfigDir/conf/services/$f","");
+ &ReadConfigFile("$ConfigDir/services/$f","");
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$ConfigDir/conf/override.conf", "services/$ThisService");
+ &ReadConfigFile("$ConfigDir/override.conf", "services/$ThisService");
@CmdList = ();
@CmdArgList = ();
@@ -419,7 +419,7 @@ my @logfiles = ();
# Find out what logfiles are defined...
my @logfiles = ();
-foreach my $LogfilesDir ("$BaseDir/default.conf", "$BaseDir/dist.conf", "$ConfigDir/conf") {
+foreach my $LogfilesDir ("$ConfigDir/defaults", "$ConfigDir/defaults", "$ConfigDir") {
if (-d "$LogfilesDir/logfiles") {
opendir(LOGFILEDIR, "$LogfilesDir/logfiles") or
die "$LogfilesDir $!";
@@ -440,13 +440,13 @@ for $ThisFile (@logfiles) {
@ReadConfigValues = ();
@Separators = ();
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$BaseDir/default.conf/logfiles/$ThisFile", "");
+ &ReadConfigFile("$ConfigDir/defaults/logfiles/$ThisFile", "");
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$BaseDir/dist.conf/logfiles/$ThisFile", "");
+ &ReadConfigFile("$ConfigDir/defaults/logfiles/$ThisFile", "");
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$ConfigDir/conf/logfiles/$ThisFile", "");
+ &ReadConfigFile("$ConfigDir/logfiles/$ThisFile", "");
push (@Separators, scalar(@ReadConfigNames));
- &ReadConfigFile("$ConfigDir/conf/override.conf", "logfiles/$ThisLogFile");
+ &ReadConfigFile("$ConfigDir/override.conf", "logfiles/$ThisLogFile");
@CmdList = ();
@CmdArgList = ();
@@ -737,7 +737,7 @@ foreach $LogFile (@LogFileList) {
foreach $LogFile (@LogFileList) {
next if ($LogFile eq 'none');
if (!defined($LogFileData{$LogFile}{'logfiles'})) {
- print "*** Error: There is no logfile defined. Do you have a $ConfigDir/conf/logfiles/" . $LogFile . ".conf file ?\n";
+ print "*** Error: There is no logfile defined. Do you have a $ConfigDir/logfiles/" . $LogFile . ".conf file ?\n";
next;
}
@@ -1302,18 +1302,14 @@ sub parselogs {
sub parselogs {
my $Service;
- #Load our ignore file order is [assume normal install] /etc/conf, /usr/share/logwatch/dist.conf and then default.conf -mgt
+ #Load our ignore file order is [assume normal install] /etc/logwatch and then /etc/logwatch/defaults -mgt
my @IGNORE;
- if ( -e "$ConfigDir/conf/ignore.conf") {
- open( IGNORE, "$ConfigDir/conf/ignore.conf" ) or return undef;
+ if ( -e "$ConfigDir/ignore.conf") {
+ open( IGNORE, "$ConfigDir/ignore.conf" ) or return undef;
@IGNORE = grep {!/(^#|^\s+$)/} <IGNORE>;
close IGNORE;
- } elsif ( -e "$BaseDir/dist.conf/ignore.conf") {
- open( IGNORE, "$BaseDir/dist.conf/ignore.conf" ) or return undef;
- @IGNORE = grep {!/(^#|^\s+$)/} <IGNORE>;
- close IGNORE;
- } elsif ( -e "$BaseDir/default.conf/ignore.conf") {
- open( IGNORE, "$BaseDir/default.conf/ignore.conf" ) or return undef;
+ } elsif ( -e "$ConfigDir/defaults/ignore.conf") {
+ open( IGNORE, "$ConfigDir/defaults/ignore.conf" ) or return undef;
@IGNORE = grep {!/(^#|^\s+$)/} <IGNORE>;
close IGNORE;
}
|