#!/bin/bash RCODE=$? if [ $(id -u) -eq 0 ] then echo "Ce script ne doit pas être lancé en tant que root" exit 1 fi for mailbox in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`; do echo "Importing mailbox : $user" ;zmmailbox -z -t 0 -m $mailbox postRestURL -u "https://127.0.0.1:7071" "//?fmt=tgz&resolve=modify" /opt/zimbra/nfsbackup/migration/archives/$mailbox.tgz ; echo "$mailbox - done "; done if [ $RCODE -eq 1 ]; then echo "erreur dans l'import'" exit 1; fi if [ $RCODE -eq 0 ]; then echo "Import terminée'" exit; fi