Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Tibor Balázs

Pages: [1]
1
Magyar / Group add script, CSV
« on: November 23, 2012, 09:16:26 pm »
Helló!

Lehet tömegesen csoportokat felvenni!  :D
Futtatáskor kicsit el van vele, de működni látszik!

A megoldás nem az én érdemem: http://hup.hu/node/119658

Code: [Select]
root@zentyal:~/bin# ./add_grup2.pl
Group created: _valami4_
Group created: _valami5_
Group created: _valami6_
root@zentyal:~/bin# cat add_grup2.pl
#!/usr/bin/perl

use strict;
use warnings;

use EBox;
use EBox::UsersAndGroups::Group;

EBox::init();

open (my $GROUPS, 'groups');

while (my $line = <$GROUPS>) {
  chomp ($line);
  my ($group, $comment, $system) = split(',', $line);
  EBox::UsersAndGroups::Group->create($group, $comment, 0);
  print "Group created: $group\n";
}
close ($GROUPS);

1;
root@zentyal:~/bin# cat groups
_valami4_,comment4,0,
_valami5_,comment5,0,
_valami6_,comment6,0,

Pages: [1]