2011/8/3 Claudinei Santos <[email protected]>: > Acho que você quer fugir do trabalho "braçal", talvez isso lhe ajude: > > #Obtendo UIDs > for i in `ldapsearch -x -D "uid=Manager,dc=pa,dc=gov,dc=br" -b > "ou=People,dc=pa,dc=gov,dc=br" \ > -w "xxxxxx" -LLL |grep -i "uid:" |awk {'print $2'}`; do > sed -i "s/\%UID\%/$i/" /tmp/mailalternate-modify.ldif > #Adicionando o atributo e seu valor > ldapmodify -x -D "uid=Manager,dc=pa,dc=gov,dc=br" -w "xxxxx" -f > /tmp/mailalternate-modify.ldif > cp -f /tmp/mailalternate-modify-template.ldif > /tmp/mailalternate-modify.ldif > done > > > - No mailalternate-modify.ldif: > dn: uid=%UID%,ou=Peopledc=pa,d,c=gov,dc=br > changetype: modify > add: objectClass > objectClass: classe_do_mailAlternateAddress > - > add: mailAlternateAddress > mailAlternateAddress: user@dc=pa,d,c=gov,dc=br, %[email protected] >
Esse é o caminho. No meu caso, acho mais elegante fazer em Python, mas coisas simples, quando são urgentes, faço com shell-script. -- Reinaldo de Carvalho http://korreio.sf.net http://python-cyrus.sf.net "While not fully understand a software, don't try to adapt this software to the way you work, but rather yourself to the way the software works" (myself) _______________________________________________ Postfix-BR mailing list [email protected] http://listas.softwarelivre.org/mailman/listinfo/postfix-br
