diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-03-06 00:20:34 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-03-06 00:20:34 +0000 |
commit | 46e89f1a659a034dc1057a087ae8e6afe454f01d (patch) | |
tree | bd199ec5fd542f42117f9c1fe997679af4a16945 /perl-install/any.pm | |
parent | df126022d1d0bdabedeb677ec31f3fa70aa5525e (diff) | |
download | drakx-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.pm | 11 |
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; |