Created
September 20, 2014 17:22
-
-
Save tuksik/1735bfa520ce7a0d68af to your computer and use it in GitHub Desktop.
Permanently delete all zarafa orphan stores
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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