X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpostinst;h=0b0086bb218b84c3ead90049eadc076f26446d0c;hb=HEAD;hp=fdb0e9b87d0e319fd92a8d246b835e0cdd4a66e7;hpb=18bd9ef227073bf8b8ae2fa386fb071691f0832e;p=dovecot-cn.git diff --git a/debian/postinst b/debian/postinst index fdb0e9b..0b0086b 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,4 +1,6 @@ -#!/bin/sh -e +#!/bin/sh + +set -e [ "$1" = "configure" ] || exit 0 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx @@ -7,45 +9,193 @@ . /usr/share/carnet-tools/functions.sh -cp_check_and_sed '^protocols' \ - 's/protocols.*$/protocols = imap imaps pop3 pop3s/g' \ - /etc/dovecot/dovecot.conf || true +move_certs() { + if [ -f /etc/dovecot/private/dovecot.pem -a ! -f /etc/dovecot/private/dovecot.key ]; then + mv -f /etc/dovecot/private/dovecot.pem /etc/dovecot/private/dovecot.key || true + fi + + if [ -f /etc/dovecot/dovecot.pem ]; then + mv -f /etc/dovecot/dovecot.pem /etc/dovecot/private/dovecot.pem || true + fi +} + +put_new_certs() { +# postavlja cert i key na nove putanje iz bustera + cp_check_and_sed '#ssl_key =