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.

59 lines
1.3 KiB

2 years ago
2 years ago
  1. #!/bin/bash
  2. RCODE=$?
  3. echo "Saisir le domaine :"
  4. read DOM
  5. cd domains
  6. rm domains.txt
  7. echo $DOM >> domains.txt
  8. cd ..
  9. echo
  10. echo "Exportation des comptes :"
  11. cd accounts
  12. rm users.txt
  13. zmprov -l gaa $DOM | tee -a users.txt
  14. cd ..
  15. echo
  16. echo "Exportation des informations sur les comptes :"
  17. cd account_details
  18. rm -r *
  19. for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep -i Name: | tee -a $user.txt ; done
  20. cd ..
  21. echo
  22. echo "Exportation des mots de passe :"
  23. cd passwords
  24. rm -r *
  25. for user in `cat ../accounts/users.txt`; do zmprov -l ga $user userPassword | grep userPassword: | awk '{ print $2}' | tee -a $user.shadow; done
  26. cd ..
  27. echo
  28. echo "Exportation des listes de diffusion :"
  29. cd distribution_lists
  30. rm -r *
  31. zmprov gadl $DOM | tee -a distribution_lists.txt
  32. for list in `cat distribution_lists.txt`; do zmprov gdlm $list > $list.txt ;echo "$list"; done
  33. cd ..
  34. echo
  35. echo "Exportation des aliases :"
  36. cd aliases
  37. rm -r *
  38. for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep zimbraMailAlias | awk '{print $2}' | tee -a $user.txt ;echo $i ;done
  39. cd ..
  40. echo
  41. if [ $RCODE -eq 1 ]; then
  42. echo "erreur dans l'export'"
  43. exit 1;
  44. fi
  45. if [ $RCODE -eq 0 ]; then
  46. echo "export terminée !!!!"
  47. echo "lancer l'import sur le serveur source"
  48. exit;
  49. fi