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.

56 lines
1.5 KiB

2 years ago
  1. #!/bin/bash
  2. #echo "Importation du domaine :"
  3. #cd domains
  4. #for domain in `cat domains.txt `; do zmprov cd $domain zimbraAuthMech zimbra ;echo $domain ;done
  5. #cd ..
  6. #echo
  7. echo "Importation des comptes :"
  8. PASSWORDS="passwords"
  9. ACCOUNT_DETAILS="account_details"
  10. USERS="accounts/users.txt"
  11. for i in `cat $USERS`
  12. do
  13. givenName=$(grep givenName: $ACCOUNT_DETAILS/$i.txt | cut -d ":" -f2)
  14. displayName=$(grep displayName: $ACCOUNT_DETAILS/$i.txt | cut -d ":" -f2)
  15. shadowpass=$(cat $PASSWORDS/$i.shadow)
  16. zmprov ca $i "TeMpPa55^()" cn "$givenName" displayName "$displayName" givenName "$givenName"
  17. zmprov ma $i userPassword "$shadowpass"
  18. done
  19. echo
  20. echo "Importation des listes de diffusion :"
  21. for lists in `cat distribution_lists/distribution_lists.txt`; do zmprov cdl $lists ; echo "$lists -- done " ; done
  22. cd distribution_lists
  23. for list in `cat distribution_lists.txt`
  24. do
  25. for mbmr in `grep -v '#' ./$list.txt | grep '@'`
  26. do
  27. zmprov adlm $list $mbmr
  28. echo " $mbmr has been added to $list"
  29. done
  30. done
  31. cd ..
  32. echo
  33. echo "Importation des aliases :"
  34. cd aliases
  35. for user in `cat ../accounts/users.txt`
  36. do
  37. echo $user
  38. if [ -f "./$user.txt" ]; then
  39. for alias in `grep '@' ./$user.txt`
  40. do
  41. zmprov aaa $user $alias
  42. echo "$user ALIAS $alias - Restored"
  43. done
  44. fi
  45. done
  46. cd ..
  47. echo
  48. echo "Fin de l'importation !!!!"
  49. echo "M)Mettre à jour la COS sur le nouveau serveur"
  50. echo "2)Configuration du domaine vers le nouveau serveur"
  51. echo "3)Lancer le script 3_exports_mailbox.sh sur l'ancien serveur"