[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Mass User Addition Script for RAQ3i
- Subject: Re: [cobalt-users] Mass User Addition Script for RAQ3i
- From: "Andy perrett" <andy@xxxxxxxxxxxxxxxxxxx>
- Date: Fri May 12 13:11:53 2000
Thanks for this but I've run into another problem.
How do I run scripts from a telnet session. when I type in the name of the
script that I have uploaded all I get back is "command not found". If I put
the script into a web space directory I simply get an internal error.
Other scripts work ok and in Telnet I am logged as root?
Do I need to enable script running within a telnet session?
Andy
----- Original Message -----
From: Vijay <vnair@xxxxxxxx>
To: <andy@xxxxxxxxxxxxxxxxxxx>
Cc: <cobalt-users@xxxxxxxxxxxxxxx>
Sent: Thursday, May 11, 2000 2:53 AM
Subject: [cobalt-users] Mass User Addition Script for RAQ3i
> Hello,
>
> Following script is developed by me with the help of Cobalt Tech Support.
> This works fine.
>
> ----------------------------------------------
> #!/usr/bin/perl
>
> # pass a comma separated list of
> #
> # username,fullname,password
> #
>
> use Getopt::Std;
> require Cobalt::User;
> use Cobalt::Meta;
>
> my $addfile = '/tmp/users.dat'; # the file which contains the users to be
> added
> my $group = "site1"; # Change the group to the one for Virtual Site you
> wanted
> 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, $name, $passwd) = split(/\,/,$usr);
> print "creating $username.. ";
> my $m = Cobalt::Meta->new("type" => "users",
> "name" => "$username",
> "group" => "$group",
> "fullname" => "$name",
> "altname" => "",
> "password1" => "$passwd",
> "password2" => "$passwd",
> "quota" => "$quota",
> "fpx" => "$fpx",
> "apop" => "$apop",
> "shell" => "$shell",
> "admin" => "$admin",
> "suspend" => "",
> "aliases" => "",
> "forward" => "",
> "vacation" => "",
> "vacationmsg" => "");
> my $res = &Cobalt::User::site_user_add($m);
> if ($res) {
> print " ERROR: $res\n";
> } else {
> print "ok\n";
> }
> }
>
> =================================
>
> Please change appropriate places for your environment.
>
> THe users I added are visible thru the GUI.
>
> Hope this helps.
>
> Vijay Nair
>
> www.trichurgateway.com
>
>
>
> _______________________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To Subscribe or Unsubscribe, please go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
>