You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

60 lines
1.3 KiB

#!/bin/bash
RCODE=$?
echo "Saisir le domaine :"
read DOM
cd domains
rm domains.txt
echo $DOM >> domains.txt
cd ..
echo
echo "Exportation des comptes :"
cd accounts
rm users.txt
zmprov -l gaa $DOM | tee -a users.txt
cd ..
echo
echo "Exportation des informations sur les comptes :"
cd account_details
rm -r *
for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep -i Name: | tee -a $user.txt ; done
cd ..
echo
echo "Exportation des mots de passe :"
cd passwords
rm -r *
for user in `cat ../accounts/users.txt`; do zmprov -l ga $user userPassword | grep userPassword: | awk '{ print $2}' | tee -a $user.shadow; done
cd ..
echo
echo "Exportation des listes de diffusion :"
cd distribution_lists
rm -r *
zmprov gadl $DOM | tee -a distribution_lists.txt
for list in `cat distribution_lists.txt`; do zmprov gdlm $list > $list.txt ;echo "$list"; done
cd ..
echo
echo "Exportation des aliases :"
cd aliases
rm -r *
for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep zimbraMailAlias | awk '{print $2}' | tee -a $user.txt ;echo $i ;done
cd ..
echo
if [ $RCODE -eq 1 ]; then
echo "erreur dans l'export'"
exit 1;
fi
if [ $RCODE -eq 0 ]; then
echo "export terminée !!!!"
echo "lancer l'import sur le serveur source"
exit;
fi