#!/bin/sh set -e POSTFIX_BCKFILE="/var/backups/mail-stack-delivery/main.cf-backup" PATH=/usr/sbin:$PATH export PATH if [ "$1" = "remove" -o "$1" = "purge" ]; then # Restore postfix configuration if [ "$1" = "remove" ]; then if which postconf >/dev/null && [ -f "${POSTFIX_BCKFILE}" ]; then while read line; do postconf -e "$line" done < "${POSTFIX_BCKFILE}" rm -f "${POSTFIX_BCKFILE}" fi fi if [ -x "/etc/init.d/postfix" ]; then if [ -x /usr/sbin/invoke-rc.d ]; then invoke-rc.d postfix restart else service postfix restart fi fi fi