summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-03-06 00:20:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-03-06 00:20:34 +0000
commit46e89f1a659a034dc1057a087ae8e6afe454f01d (patch)
treebd199ec5fd542f42117f9c1fe997679af4a16945 /perl-install/any.pm
parentdf126022d1d0bdabedeb677ec31f3fa70aa5525e (diff)
downloaddrakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar.gz
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar.bz2
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.tar.xz
drakx-46e89f1a659a034dc1057a087ae8e6afe454f01d.zip
move inittab modifying to any::runlevel
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 34e51c442..eb6fe6418 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -781,4 +781,15 @@ sub write_passwd_user {
} "$prefix/etc/passwd";
}
+sub runlevel {
+ my ($prefix, $runlevel) = @_;
+ my $f = "$prefix/etc/inittab";
+ -r $f or log::l("missing inittab!!!"), return;
+ if ($runlevel) {
+ substInFile { s/^id:\d:initdefault:\s*$/id:$runlevel:initdefault:\n/ } $f;
+ } else {
+ cat_($f) =~ /^id:(\d):initdefault:\s*$/ && $1;
+ }
+}
+
1;