summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-02-02 17:41:20 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-02-02 17:41:20 +0000
commit992308b51918c7929c235a89ffaaecb85649df66 (patch)
tree59cd31b405d1d406573dfe0ab1de5efb2909b4dd /perl-install
parentf448d6825b269ac6e10f9ed2e22f037013856eb5 (diff)
downloaddrakx-992308b51918c7929c235a89ffaaecb85649df66.tar
drakx-992308b51918c7929c235a89ffaaecb85649df66.tar.gz
drakx-992308b51918c7929c235a89ffaaecb85649df66.tar.bz2
drakx-992308b51918c7929c235a89ffaaecb85649df66.tar.xz
drakx-992308b51918c7929c235a89ffaaecb85649df66.zip
add "remove cron entry" on arnaud request
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/logdrake23
1 files changed, 21 insertions, 2 deletions
diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake
index ea7303a9d..455598e04 100755
--- a/perl-install/standalone/logdrake
+++ b/perl-install/standalone/logdrake
@@ -365,6 +365,12 @@ sub alert_config() {
use wizards;
my $w = wizards->new;
+ my $mode;
+ my $cron_file = "/etc/cron.hourly/logdrake_service";
+ my %modes = (
+ configure => N("Configure the mail alert system"),
+ disable => N("Stop the mail alert system"),
+ );
my $wiz = {
defaultimage => "wiz_logdrake.png",
name => N("Mail alert"),
@@ -373,7 +379,12 @@ sub alert_config() {
name => N("Mail alert configuration") . "\n\n" .
N("Welcome to the mail configuration utility.\n\nHere, you'll be able to set up the alert system.\n"),
no_back => 1,
- next => 'services'
+ data => [
+ { val => \$mode, label => N("What do you wan to do?"),
+ list => [ keys %modes ], format => sub { $modes{$_[0]} }, },
+ ],
+
+ post => sub { $mode eq 'configure' ? 'services' : 'stop' },
},
services => {
name => N("Services settings") . "\n\n" .
@@ -412,14 +423,22 @@ sub alert_config() {
no_back => 1,
next => 0
},
+ stop => {
+ pre => sub { rm_rf($cron_file) },
+ name => N("Congratulations") . "\n\n" . N("The wizard successfully disabled the mail alert."),
+ end => 1,
+ no_back => 1,
+ next => 0
+ },
},
};
$w->process($wiz, $in);
+ return if $mode eq 'disable';
$options{SERVICES} = join ':', grep { $services_to_check{$_} } sort keys %services_to_check;
use Data::Dumper;
- output_with_perm "/etc/cron.hourly/logdrake_service", 0755, q(#!/usr/bin/perl
+ output_with_perm $cron_file, 0755, q(#!/usr/bin/perl
# generated by logdrake
use MDK::Common;
my $r;