Scripting Zarafa Server Updates

Zarafa Collaboration Platform is the email server of choice for our new customers. With that said, we have a lot of these installations being maintained in production. Below is the first run through of an automation script I wrote last year to update Zarafa to the latest release for users who are not using apt-get. Note this script is just the basics and can be easily modified to be run via SaltStack after the update has been tested in the development environment. Please note that on lines 24 and 25 of the attached script that the zarafa-ical and zarafa-gateway upstart scripts are being removed as this particular client does not use them. If they are in use in your installation, please ensure you either comment those lines out or remove them from the script altogether. Updates can be found here.

#!/bin/bash
# This script updates zarafa server with the package provided by the download link.

echo "Please insert zarafa download link, followed by [ENTER]:"
read download
apt-get update && apt-get dist-upgrade
cp -r /etc/zarafa /etc/zarafa.bkp
cd /etc/zarafa.bkp
mysqldump -h mysql_host -u mysql_username -p'mysql_password' zarafa > zarafa-dump.sql
cd /tmp
wget $download
file="${download##*/}"
tar xvzf $file
folder=`basename "$file" -free.tar.gz`
cd $folder;
dpkg -Bi l*
dpkg -i p*
dpkg -i z*
dpkg -Bi l*
dpkg -i p*
dpkg -i z*
apt-get install -f
apt-get autoremove
update-rc.d -f zarafa-ical remove
update-rc.d -f zarafa-gateway remove
service apache2 restart
zarafa-admin -V
#echo "Please insert zarafa windows client download link, followed by [ENTER]:"
#read client
#cd /etc/zarafa/client
#wget $client
echo "Please verify that zarafa is functioning properly and then delete backup at /etc/zarafa.bkp and tmp files"
Did you find this article useful? Why not share it with your friends?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.