#!/bin/bash
BAK="/etc/kolab/backup/`date +%Y%m%d-%H%M%S`"

echo "Backuping config files in $BAK"
mkdir -p $BAK
for files in /etc/postfix/main.cf /etc/postfix/master.cf \
  /etc/postfix/transport /etc/postfix/virtual \
  /etc/cyrus.conf /etc/imapd.conf \
  /etc/proftpd.conf /etc/openldap/slapd.conf \
  /etc/sysconfig/saslauthd
  do cp $files $BAK
done
cp -a /var/lib/ldap $BAK

for service in ldap saslauthd cyrus-imapd httpd postfix
do chkconfig --level 35 $service off
done

#Temporary hack 
perl -pi -e "s|TLS_CACERT |#TLS_CACERT |;" /etc/openldap/ldap.conf

/etc/init.d/kolab-server stop

/usr/sbin/kolab_bootstrap.real -b

