From 3d1b97c3fcb4bd089c7abc9bdbccf6a005e0fa2d Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Thu, 7 Nov 2013 08:45:13 +0100 Subject: [PATCH] Fix dovecot upgrade. --- src/functions.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/functions.sh b/src/functions.sh index 2e7a776..76e1eff 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -913,7 +913,15 @@ upgrade_postfix () { # upgrade the IMAP server upgrade_dovecot() { - if [ ! -f /etc/dovecot/conf.d/95-local ]; then + local local_conf=/etc/dovecot/conf.d/95-${backup_ext}.conf + + if [ -f /etc/dovecot/conf.d/95-local -a ! -f $local_conf ]; then + mv /etc/dovecot/conf.d/95-local $local_conf + sed -i 's/\/usr\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf + /etc/init.d/dovecot restart + fi + + if [ ! -f $local_conf ]; then pkgrm dovecot-cn # restore config @@ -943,7 +951,8 @@ upgrade_dovecot() { # install new version and restore local changes pkgadd dovecot-core - doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > /etc/dovecot/conf.d/95-local + doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > $local_conf + sed -i 's/\/user\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf pkgadd dovecot-cn fi -- 1.7.10.4