Oops, I forgot: there's a filter for the ldat query output so I was only taken the email. Check the query:
Code:
$LDAPSEARCH -x -H $LDAP_SERVER -b $BASEDN -D "$BINDDN" -w $BINDPW "$FILTER" $FIELDS | \
grep "@$DOMAIN_NAME" | \
awk '{print $2}' | \
sort > $ADS_TMP As you see, I'm doing a
grep for the domain name and then an
awk to read only the second column.
So it will be necesary to change that grep into grep -e attr -e attr and maybe remove or adjust the awk line.
Also I see that more changes must be done, since my original idea was to make a diff between two sorted email lists, but now one of those list will have more fields.
Maybe to simplify the script should create 2 output files, one with just the email, to make the diff, and other one with the attributes, which can be grep-ed on real time just before zmprov command.
Hey! This mod sounds quite interesting, as it will make a powerful script. Think I'm gonna work on it. I will also add a previous modification I made in a recent zimbra installation so that the script checks the availability of both ldap servers to make sure they're online.
I hope I can give you more details tomorrow, as today I'll be in an in-situ installation.
P.D. Y aqui tienes a dos españoles hablando en inglés entre ellos. Maldita globalizacion... Saludos desde Madrid.