Skip to content

Instantly share code, notes, and snippets.

@tuksik
Created September 20, 2014 17:22
Show Gist options
  • Save tuksik/1735bfa520ce7a0d68af to your computer and use it in GitHub Desktop.
Save tuksik/1735bfa520ce7a0d68af to your computer and use it in GitHub Desktop.
Permanently delete all zarafa orphan stores
#/bin/bash
#http://www.zarafa.com/wiki/index.php/Permanently_delete_all_orphan_stores
ZARAFA_ADMIN=`which zarafa-admin`
AWK=`which awk`
echo
echo "ALERT - This script will permanently delete all orphan stores!!!"
echo -n "Are you sure you want to continue [y/n]: "
read USERINPUT
echo
if [ "$USERINPUT" == "y" ]; then
$ZARAFA_ADMIN --list-orphans | tail -n+4 | $AWK '{print $1}' |while read STOREID; do
echo "Removing store: $STOREID"
$ZARAFA_ADMIN --remove-store $STOREID
done
else
echo "Cancelled"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment