Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
tuto:ipasserelle:divers:scripts_dokuwiki [27/11/2013 12:38] dani |
tuto:ipasserelle:divers:scripts_dokuwiki [18/12/2013 10:06] dani |
||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
Voilà quelques scripts qui permettent de générer des tableaux au format dokuwiki: | Voilà quelques scripts qui permettent de générer des tableaux au format dokuwiki: | ||
- | * Génère un tableau de tous les dossiers partagés (uniquement via la contrib | + | * Génère un tableau de tous les dossiers partagés (smeserver-shared-folders |
<file perl shares.pl> | <file perl shares.pl> | ||
# | # | ||
Ligne 25: | Ligne 25: | ||
} | } | ||
elsif ($remote eq ' | elsif ($remote eq ' | ||
- | $rem = ' | + | $rem = ' |
} | } | ||
elsif ($remote eq ' | elsif ($remote eq ' | ||
- | $rem = ' | + | $rem = ' |
} | } | ||
elsif ($remote eq ' | elsif ($remote eq ' | ||
- | $rem = ' | + | $rem = ' |
} | } | ||
elsif ($remote eq ' | elsif ($remote eq ' | ||
- | $rem = ' | + | $rem = ' |
} | } | ||
elsif ($remote eq ' | elsif ($remote eq ' | ||
Ligne 41: | Ligne 41: | ||
my $com = ''; | my $com = ''; | ||
if ($name eq ' | if ($name eq ' | ||
- | $com = " | + | $com = " |
} | } | ||
elsif ($name eq ' | elsif ($name eq ' | ||
- | $com = " | + | $com = " |
} | } | ||
elsif ($name eq ' | elsif ($name eq ' | ||
- | $com = " | + | $com = " |
} | } | ||
elsif ($name eq ' | elsif ($name eq ' | ||
- | $com = " | + | $com = " |
} | } | ||
print ' | print ' | ||
+ | } | ||
+ | foreach my $ibay ($a-> | ||
+ | my $name = $ibay-> | ||
+ | my $access = $ibay-> | ||
+ | my $remote = $ibay-> | ||
+ | my $group = $ibay-> | ||
+ | my $com = $ibay-> | ||
+ | my $w = ''; | ||
+ | my $r = ''; | ||
+ | my $rem = ''; | ||
+ | if ($access eq ' | ||
+ | $w = $group; | ||
+ | } | ||
+ | elsif ($access eq ' | ||
+ | $w = $group; | ||
+ | $r = 'Tous les utilisateurs'; | ||
+ | } | ||
+ | elsif ($access eq ' | ||
+ | $w = ' | ||
+ | $w = $group; | ||
+ | } | ||
+ | if ($remote eq ' | ||
+ | $rem = ' | ||
+ | } | ||
+ | elsif ($remote eq ' | ||
+ | $rem = ' | ||
+ | } | ||
+ | elsif ($remote eq ' | ||
+ | $rem = ' | ||
+ | } | ||
+ | elsif ($remote eq ' | ||
+ | $rem = ' | ||
+ | } | ||
+ | elsif ($remote eq ' | ||
+ | $rem = ' | ||
+ | } | ||
+ | elsif ($remote eq ' | ||
+ | $rem = ' | ||
+ | } | ||
+ | print ' | ||
} | } | ||
</ | </ | ||
Ligne 96: | Ligne 136: | ||
print ' | print ' | ||
+ | </ | ||
+ | |||
+ | * Génère un tableau avec les groupes (et leur pseudo pointant dessus) et la liste des utilisateurs qui recevront les mails | ||
+ | <file perl grpmail.pl> | ||
+ | # | ||
+ | |||
+ | use esmith:: | ||
+ | |||
+ | my $a = esmith:: | ||
+ | |||
+ | print ' | ||
+ | |||
+ | foreach my $group ($a-> | ||
+ | my $name = $group-> | ||
+ | my $addr = $name; | ||
+ | foreach my $pseudo ($a-> | ||
+ | my $target = $pseudo-> | ||
+ | $addr .= '\\\\ ' . $pseudo-> | ||
+ | } | ||
+ | my @members = split ',', | ||
+ | print ' | ||
+ | foreach my $member (@members){ | ||
+ | my $acc = $a-> | ||
+ | my $first = $acc-> | ||
+ | my $last = $acc-> | ||
+ | print " | ||
+ | } | ||
+ | print ' |' . " | ||
+ | } | ||
</ | </ |