#!/bin/sh set -e # Debian Postfix preinst # LaMont Jones # Modified to use debconf by Colin Walters # do we have debconf? if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule DEBCONF=true else DEBCONF= fi mkdir -Zp -m755 /var/spool/postfix case "$1" in install) rm -f /var/spool/postfix/restart /var/spool/postfix/reload ;; upgrade) if [ -d /var/spool/postfix ] && [ -f /etc/postfix/main.cf ]; then touch /var/spool/postfix/restart fi # If user has not modified master/main.proto, move aside so new version # is installed (#991513) cmp -s /usr/share/postfix/main.cf.dist /etc/postfix/main.cf.proto && \ mv /etc/postfix/main.cf.proto /etc/postfix/main.cf.proto.old \ || echo "/etc/postfix/main.cf.proto modified, not updating." cmp -s /usr/share/postfix/master.cf.dist /etc/postfix/master.cf.proto && \ mv /etc/postfix/master.cf.proto /etc/postfix/master.cf.proto.old \ || echo "/etc/postfix/master.cf.proto modified, not updating." ;; abort-upgrade) if [ -f /etc/postfix/main.cf.proto.old ]; then mv /etc/postfix/main.cf.proto.old /etc/postfix/main.cf.proto echo "Restoring old /etc/postfix/main.cf.proto on failed upgrade." fi if [ -f /etc/postfix/master.cf.proto.old ]; then mv /etc/postfix/master.cf.proto.old /etc/postfix/master.cf.proto echo "Restoring old /etc/postfix/master.cf.proto on failed upgrade." fi ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER#