[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] add user script



on raq4
check /usr/sbin/cobalt
there exists all kind of scripts to add an  delete virtual sites as well as
users
after my posting to the maillist I was searching further on and found this

to add useres to speific site I use a script like:

#!/usr/bin/perl

# pass a comma separated list of
#
# username,fullname,password,email
#

# the file which contains the users to be
my $addfile = 'users.dat'; 

# the site to which the useres should be added
my $sitename = "site1"; 

my $quota = 5;       # Disk quota in MB
my $fpx = "off";     # Front Page Support
my $apop = "off";    # Apop support
my $admin = "off";   # User is admin or not
my $shell = "off";   # allow shell access

open IN, $addfile;
flock (IN,2);
@userdata = <IN>;
close IN;

foreach $usr (@userdata) {
	chomp($usr);
	($username, $fullname, $passwd, $email) = split(",",$usr);
	print "Adding $username:$fullname:$passwd:$email\n";
    system("/usr/sbin/cobalt/adduser -g $sitename -u $username -f
\"$fullname\" -p $passwd -e $email -q $quota");
}


Peter