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

#!/bin/bash
#echo "Importation du domaine :"
#cd domains
#for domain in `cat domains.txt `; do zmprov cd $domain zimbraAuthMech zimbra ;echo $domain ;done
#cd ..
#echo
echo "Importation des comptes :"
PASSWORDS="passwords"
ACCOUNT_DETAILS="account_details"
USERS="accounts/users.txt"
for i in `cat $USERS`
do
givenName=$(grep givenName: $ACCOUNT_DETAILS/$i.txt | cut -d ":" -f2)
displayName=$(grep displayName: $ACCOUNT_DETAILS/$i.txt | cut -d ":" -f2)
shadowpass=$(cat $PASSWORDS/$i.shadow)
zmprov ca $i "TeMpPa55^()" cn "$givenName" displayName "$displayName" givenName "$givenName"
zmprov ma $i userPassword "$shadowpass"
done
echo
echo "Importation des listes de diffusion :"
for lists in `cat distribution_lists/distribution_lists.txt`; do zmprov cdl $lists ; echo "$lists -- done " ; done
cd distribution_lists
for list in `cat distribution_lists.txt`
do
for mbmr in `grep -v '#' ./$list.txt | grep '@'`
do
zmprov adlm $list $mbmr
echo " $mbmr has been added to $list"
done
done
cd ..
echo
echo "Importation des aliases :"
cd aliases
for user in `cat ../accounts/users.txt`
do
echo $user
if [ -f "./$user.txt" ]; then
for alias in `grep '@' ./$user.txt`
do
zmprov aaa $user $alias
echo "$user ALIAS $alias - Restored"
done
fi
done
cd ..
echo
echo "Fin de l'importation !!!!"
echo "M)Mettre à jour la COS sur le nouveau serveur"
echo "2)Configuration du domaine vers le nouveau serveur"
echo "3)Lancer le script 3_exports_mailbox.sh sur l'ancien serveur"