2 # prerm script for amavisd-cn
4 # see: dh_installdeb(1)
8 # summary of how this script can be called:
10 # * <old-prerm> `upgrade' <new-version>
11 # * <new-prerm> `failed-upgrade' <old-version>
12 # * <conflictor's-prerm> `remove' `in-favour' <package>
14 # * <deconfigured's-prerm> `deconfigure' `in-favour'
15 # <package-being-installed> <version> `removing'
16 # <conflicting-package> <version>
17 # for details, see http://www.debian.org/doc/debian-policy/ or
18 # the debian-policy package
20 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -x
22 . /usr/share/carnet-tools/functions.sh
26 main_cf=/etc/postfix/main.cf
27 master_cf=/etc/postfix/master.cf
30 egrep -v "^$1[[:blank:]]*=[[:blank:]]*" $main_cf > $main_cf.dpkg-tmp.$$
31 cp_mv $main_cf.dpkg-tmp.$$ $main_cf
34 if [ "$1" = remove ]; then
35 if grep -q $PKG $master_cf; then
36 cp-update -r $PKG $master_cf >&-
37 del_postconf content_filter
38 echo "Removed postfix configuration for ${PKG}."
39 service postfix restart
41 cp-update -r $PKG $ALIASES >&-
47 # dh_installdeb will replace this with shell code automatically
48 # generated by other debhelper scripts.