File: //var/lib/dpkg/info/sendmail-bin.prerm
#!/bin/sh
set -e;
PACKAGE=sendmail-bin;
if [ "$1" = "remove" ]; then
# Remove alternatives for MTA, MSP
update-alternatives --remove sendmail-mta /usr/lib/sm.bin/sendmail;
update-alternatives --remove sendmail-msp /usr/lib/sm.bin/sendmail;
if [ -x /etc/init.d/sendmail ] && \
[ -x /usr/share/sendmail/sendmail ]; then
invoke-rc.d --quiet --force sendmail stop
fi;
# Prevent cronjob from running during upgrade...
if [ -f /etc/cron.d/sendmail ]; then
rm -f /etc/cron.d/sendmail;
fi;
fi
if [ "$1" = "upgrade" ]; then
# Prevent cronjob from running during upgrade...
if [ -f /etc/cron.d/sendmail ]; then
echo "#prerm" > /etc/cron.d/sendmail;
fi;
# NOTE NOTE NOTE NOTE NOTE
# If we fall through to DEBHELPER, sendmail will be stopped
# much earlier than necessary !!!
exit 0;
fi
# Automatically added by dh_installinit/11.1.4ubuntu1
if [ -x "/etc/init.d/sendmail" ] && [ "$1" = remove ]; then
invoke-rc.d sendmail stop || exit 1
fi
# End automatically added section