[K12OSN] scripting guru's, quotas challenge
Brian Chivers
brian at portsmouth-college.ac.uk
Sun Jul 5 14:29:57 UTC 2009
Barry Cisna wrote:
> Hi Brain,
>
> Thanks for the tip. Unfortunately,I do not quite understand how you
> incorporated this? I assume you mean bulk adding via an ldap bulk add
> script? Can you give a process:
> 1.__
> 2.__
> 3.__
> 4.__ This is what it should look like with an successful add.
> I am dumb I guess...:)
>
> Thanks,
> Barry
>
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
>
No problem, I'm using an old bulk script,it version v 1.15
First I created a user & set the quota's I wanted called idealstudent
then I added some lines to the script, right at the start I added this
my $idealquota = "idealstudent";
Then at about line 223 I added the line below with the edquota bit in,
I've included the whole section but it's the line my $rc2 that you're
interested in.
# Add the user
my $rc = system("/usr/sbin/smbldap-useradd -a -m -g $gid -c \"$first
$last\" -s $shell -d $home $uname");
if ($rc == 0) {
# the user was successfully added
my $rc2 = system("/usr/sbin/edquota -p $idealquota $uname");
print OUTPUT "$first,$last,$uname,$gid,$shell,$home,$password,$slip\n";
if (!defined($opt_i) and defined($opt_o)) {
print STDOUT
"$first,$last,$uname,$gid,$shell,$home,$password,$slip\n";
}
I think the newer bulk add scripts have this in already as when I first
did this way back when I send it to the list & the script guru's said
they were going to add it so it might be worth looked through to see if
it's there.
Hope this help
Brian
------------------------------------------------------------------------------------------------
The views expressed here are my own and not necessarily
the views of Portsmouth College
More information about the K12OSN
mailing list