i just recognized that attachements do not make it to the list...
so, here it comes:
--------------------------------------
#!/usr/bin/perl -w
$debug = 1;
$exist = 0;
open STDIN,"<";
while (<STDIN>){
$exist = 1;
($uname,$x,$uid,$gid,$comment,$homedir,$shell) = split ":",$_;
chomp ($uname,$x,$uid,$gid,$comment,$homedir,$shell);
# $debug && print " -- found
$uname:$x:$uid:$gid:$comment:$homedir:$shell\n";
# checking whether user exist
open PASSWD," 100){
print "Executing 'useradd -u $uid -g $gid -c \"$comment\" -d $homedir
-s $shell $uname' ... ";
#`useradd -u $uid -g $gid -c \"$comment\" -d $homedir -s $shell
$uname`;
print "done.\n";
} else {
print " * useradd -u $uid -g $gid -c \"$comment\" -d $homedir -s $shell
$uname\n";
}
} else {
print " * User $uname already exist!\n";
}
}
close STDIN;
exit 0;
-------------------------
-----Original Message-----
From: Peer Stefan [mailto:stefan.peer@tiwag.at]
Sent: Wednesday, April 03, 2002 2:15 PM
To: Suse-Security
Subject: RE: [suse-security] OT: User accounts
i once wrote a script myself, which adds users from any unix-like
password-file to a system (reads STDIN). have a look at the attachment. it's
provided 'asis' - feel free to add or delete stuff as you like.
cheers
stefan
ps: it just adds users with uids greater than 100 - so no system user is
added.
-----Original Message-----
From: Michael Stern [mailto:mhstar@gmx.at]
Sent: Wednesday, April 03, 2002 2:07 PM
To: Suse-Security
Subject: Re: [suse-security] OT: User accounts
well of course you could create a script manually which reads and parses an
input file and passes the data to useradd and whatever program you want to
execute ... i don't know whether suse does provide one, but it shouldn't be
too difficult to write such a script.
----- Original Message -----
From: