Your IP : 3.139.86.74


Current Path : /var/lib/dpkg/info/
Upload File :
Current File : /var/lib/dpkg/info/ispmanager-pkg-opendkim-exim.postinst

#!/bin/bash
# postinst script for coremanager
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

COREDIR=/usr/local/mgr5
CONFNAME=opendkim.conf
. ${COREDIR}/lib/pkgsh/core_pkg_funcs.sh
. ${COREDIR}/lib/pkgsh/ispmgr_pkg_funcs.sh

EXIMCONF=/etc/exim4/exim4.conf.template

case "$1" in
    configure)
		if [ "#${ISPCONVERT}" = "#yes" ]; then
			PATHLIST="opendkim-keyspath opendkim-genkey"
			PARAMLIST="DkimCheck"
			PathConvert ${COREDIR}/etc/conf.d/opendkim-exim.conf
			ParamConvert ${COREDIR}/etc/conf.d/opendkim-exim.conf
		else
			sed -i -r 's|__ISP_DKIM_KEYS__|/etc/exim4/ssl|g' ${EXIMCONF}
			if ! grep -q "DKIM_ENABLE = " ${EXIMCONF} ; then
				sed -i -r "1 iDKIM_ENABLE = yes" ${EXIMCONF}
				ReloadService exim4
			fi
			if [ -n ${2} ]; then
				if ! grep -qE 'dkim_(selector|private_key)\s*=.*lookup' /etc/exim4/exim4.conf.template; then
					sed -i -r 's!(dkim_(selector|private_key)\s*=.*)(\$sender_address_domain\.(txt|private))!\1${lookup {\3} dsearch {/etc/exim4/ssl}}!' /etc/exim4/exim4.conf.template
					ReloadService exim4
				fi
			fi
		fi
		
		MakeConfigLink opendkim opendkim-exim
		ReloadMgr ${ISPMGR}
	
		if [ -z ${2} ]; then
			# Afterinstall
			AfterinstallModule ${ISPMGR} opendkim
		fi
	
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0