X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=dovecot-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;h=1caedc80a59a272cc85807ef55d4e3481dbe1ab7;hp=110f226795b6708027fb7d03922c455aef2b110f;hb=878b239bbaf158f89da80f5a87fcbe2441a05f68;hpb=0e6678d145ec4d219dc722f1fec0be0eab122bc7 diff --git a/debian/postinst b/debian/postinst index 110f226..1caedc8 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 @@ -39,17 +41,36 @@ cp_check_and_sed '#ssl =' \ 's/^#ssl =/ssl =/g' \ /etc/dovecot/conf.d/10-ssl.conf || true +# trazio zelja +cp_check_and_sed 'ssl = no' \ + 's/^ssl = no/ssl = yes/g' \ + /etc/dovecot/conf.d/10-ssl.conf || true + +if ! grep -q ^ssl_cert /etc/dovecot/conf.d/10-ssl.conf \ + && ! grep -q ^ssl_key /etc/dovecot/conf.d/10-ssl.conf; then + + if [ ! -f /etc/dovecot/dovecot.pem -a ! -f /etc/dovecot/private/dovecot.pem ]; then + echo "CN: Generating certificate and key..." + /usr/share/dovecot-cn/mkcert.sh || true + fi + + cp_check_and_sed '#ssl_cert =