#!/bin/bash
# script skeleton to do something for all accounts, except ${exclude_accounts}.
# this script should be run as root
# customize these to your needs:
exclude_accounts="admin wiki galsync system-ham system-spam system-virus-quarantine"
# get all account to $accounts
accounts=`su - zimbra -c 'zmprov -l gaa'`;
# loop for each account
for account in ${accounts}; do
account_uid=`echo ${account} | cut -d '@' -f1`
echo ${exclude_accounts} | grep -q -e ${account_uid}
if [ $? -eq 0 ] ; then
echo "### Skipped ${account}"
continue
fi
# your code starts here:
echo "Processing ${account} ..."
done
Back to top