summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakxservices
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-09 00:52:32 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-09 00:52:32 +0000
commitd59b27d5fcc346d96072ed0edb88cda0223be084 (patch)
treef605bc19591d3cf23d372a5ace6c70fbe367a620 /perl-install/standalone/drakxservices
parent1934b3123c81c2ccb425626aa61ed29e38780ddf (diff)
downloaddrakx-d59b27d5fcc346d96072ed0edb88cda0223be084.tar
drakx-d59b27d5fcc346d96072ed0edb88cda0223be084.tar.gz
drakx-d59b27d5fcc346d96072ed0edb88cda0223be084.tar.bz2
drakx-d59b27d5fcc346d96072ed0edb88cda0223be084.tar.xz
drakx-d59b27d5fcc346d96072ed0edb88cda0223be084.zip
no_comment
Diffstat (limited to 'perl-install/standalone/drakxservices')
-rwxr-xr-xperl-install/standalone/drakxservices30
1 files changed, 30 insertions, 0 deletions
diff --git a/perl-install/standalone/drakxservices b/perl-install/standalone/drakxservices
new file mode 100755
index 000000000..621def75f
--- /dev/null
+++ b/perl-install/standalone/drakxservices
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+
+use common qw(:common :functional);
+use interactive;
+
+local $_ = join '', @ARGV;
+
+/-h/ and die "usage: drakxservices\n";
+
+$::isStandalone = 1;
+
+my $in = vnew interactive('su');
+
+my @l = map { chop; $_ } `cd /etc/rc.d/init.d ; grep -l "chkconfig:" *`;
+my @before = map { bool(@_ = glob("/etc/rc.d/rc*.d/*$_")) } @l;
+
+my $after = $in->ask_many_from_list("drakxservices",
+_("Choose which services should be automatically started at boot time"),
+ \@l, \@before);
+
+mapn {
+ my ($name, $before, $after) = @_;
+ if ($before != $after) {
+ system("chkconfig", $after ? "--add" : "--del", $name);
+ }
+} \@l, \@before, $after;
+
+$in->exit(0);