#!/bin/sh set -e [ "$DEBIAN_SCRIPT_DEBUG" ] && set -x . /usr/share/carnet-tools/functions.sh PKG=amavisd-cn ALIASES=/etc/aliases main_cf=/etc/postfix/main.cf master_cf=/etc/postfix/master.cf del_postconf() { egrep -v "^$1[[:blank:]]*=[[:blank:]]*" $main_cf > $main_cf.dpkg-tmp.$$ cp_mv $main_cf.dpkg-tmp.$$ $main_cf } if [ "$1" = remove ]; then if grep -q $PKG $master_cf; then cp-update -r $PKG $master_cf >&- del_postconf content_filter echo "Removed postfix configuration for ${PKG}." if pgrep -u root -f /usr/lib/postfix/master >&- && \ [ -x /etc/init.d/postfix ] >&- ; then if [ -x /usr/sbin/invoke-rc.d ]; then invoke-rc.d postfix restart else /etc/init.d/postfix restart fi fi fi cp-update -r $PKG $ALIASES >&- if [ -x /usr/bin/newaliases ]; then newaliases fi fi