summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/logdrake
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/logdrake')
-rwxr-xr-xperl-install/standalone/logdrake13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake
index 4f393a845..8a0d69740 100755
--- a/perl-install/standalone/logdrake
+++ b/perl-install/standalone/logdrake
@@ -379,7 +379,7 @@ sub alert_config() {
my $cron = q(#!/usr/bin/perl
# generated by logdrake
use MDK::Common;
-my $r = "*** " . chomp_(`date`) . " ***\n";
+my $r;
);
@@ -459,12 +459,15 @@ EOF
my $email = ) . "'$email';\n\n";
- $cron .= q(my $F;
-open $F, '|/usr/sbin/sendmail -oi -t';
-print $F q(Subject: logdrake Mail Alert
+ $cron .= q(if ($r) {
+ my $F;
+ open $F, '|/usr/sbin/sendmail -oi -t';
+ print $F q(Subject: logdrake Mail Alert
From: root@localhost
To: ), "$email\n";
-print $F $r;
+ print $F "*** " . chomp_(`date`) . " ***\n";
+ print $F $r;
+}
# EOF);
output_with_perm "/etc/cron.hourly/logdrake_service", 0755, $cron;