summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/XFdrake2
-rwxr-xr-xperl-install/standalone/adduserdrake54
-rwxr-xr-xperl-install/standalone/drakxservices2
3 files changed, 37 insertions, 21 deletions
diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake
index fb5eb9d00..6ebfbca0a 100755
--- a/perl-install/standalone/XFdrake
+++ b/perl-install/standalone/XFdrake
@@ -49,6 +49,6 @@ system("mount /proc 2>/dev/null"); # ensure /proc is mounted for pci probing
my $i = $0 =~ Xdrakres ? Xconfig::getinfoFromXF86Config() : {};
Xconfig::getinfo($i);
-Xconfigurator::main('', $i, $in, 0, 0, sub { system("urpmi --auto XFree86-$_[0]") });
+Xconfigurator::main('', $i, $in, 0, -e "/etc/pcmcia", sub { system("urpmi --auto XFree86-$_[0]") });
$in->exit(0);
diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake
index 0bc27dd94..87384e06b 100755
--- a/perl-install/standalone/adduserdrake
+++ b/perl-install/standalone/adduserdrake
@@ -8,20 +8,27 @@ use any;
local $_ = join '', @ARGV;
-/-h/ and die "usage: adduserdrake [--beginner] [--expert]\n";
+/-h/ and die "usage: adduserdrake [--beginner] [--expert] [<users...>]\n";
$::beginner = /-beginner/;
$::expert = /-expert/;
$::isStandalone = 1;
-my $in = vnew interactive('su');
-
my @etc_pass_fields = qw(name pw uid gid realname home shell);
my @shells = grep { -x $_ } map { "/bin/$_" } qw(bash tcsh zsh ash ksh);
my $isMD5 = cat_("/etc/pam.d/passwd") =~ /md5/;
my $isShadow = cat_("/etc/pam.d/passwd") =~ /shadow/;
my $security = $ENV{SECURE_LEVEL};
+
+
+if (my @l = grep { ! /^-/ } @ARGV) {
+ addusers(map {{ name => $_, realname => $_ }} @l);
+ exit 0;
+}
+
+my $in = vnew interactive('su');
+
new:
if ($in->ask_from_entries_refH(
[ _("Add user"), _("Accept user"), _("Done") ],
@@ -51,25 +58,34 @@ if ($in->ask_from_entries_refH(
},
)) {
push @users, $u;
- $u->{pw} = $isMD5 ? c::crypt_md5($u->{password}, salt(8)) : crypt($u->{password}, salt(2));
$u = {};
goto new;
}
-my @u = map { $_->{name} } @users;
-
-system("adduser $_") foreach @u;
-any::addUsers('', @u);
-
-substInFile {
- foreach my $u (@users) {
- if (/^$u->{name}:/) {
- chomp;
- my %l; @l{@etc_pass_fields} = split ':';
- add2hash($u, \%l);
- $_ = join(':', @$u{@etc_pass_fields}) . "\n";
- }
+
+addusers(@users);
+
+sub addusers {
+ my @u = map { $_->{name} } my @users = @_;
+
+ foreach (@users) {
+ $_->{pw} = $isMD5 ? c::crypt_md5($_->{password}, salt(8)) : crypt($_->{password}, salt(2));
+ $_->{shell} ||= "/bin/bash";
}
-} "/etc/passwd";
-system("pwconv") if $isShadow;
+
+ system("adduser $_") foreach @u;
+ any::addUsers('', @u);
+
+ substInFile {
+ foreach my $u (@users) {
+ if (/^$u->{name}:/) {
+ chomp;
+ my %l; @l{@etc_pass_fields} = split ':';
+ add2hash($u, \%l);
+ $_ = join(':', @$u{@etc_pass_fields}) . "\n";
+ }
+ }
+ } "/etc/passwd";
+ system("pwconv") if $isShadow;
+}
$in->exit(0);
diff --git a/perl-install/standalone/drakxservices b/perl-install/standalone/drakxservices
index c463308da..b551055d6 100755
--- a/perl-install/standalone/drakxservices
+++ b/perl-install/standalone/drakxservices
@@ -15,7 +15,7 @@ $::isStandalone = 1;
my $in = vnew interactive('su');
my @l = grep { !/\.rpm/ } map { chop; $_ } `cd /etc/rc.d/init.d ; grep -l "chkconfig:" *`;
-my @before = map { bool(@_ = glob("/etc/rc.d/rc*.d/*$_")) } @l;
+my @before = map { bool(@_ = glob("/etc/rc.d/rc*.d/S*$_")) } @l;
my $after = $in->ask_many_from_list("drakxservices",
_("Choose which services should be automatically started at boot time"),