File: /var/lib/dpkg/info/imunify360-pam.prerm
#!/bin/sh
# prerm script for imunify360-webshield-bundle
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|upgrade|deconfigure)
if [ "$1" = remove -o "$1" = purge ];then
if [ -e /usr/sbin/imunify360-pam ]; then
# 'imunify360-pam {enable|disable|disable-all}' is idempotent command
/usr/sbin/imunify360-pam disable-all >/dev/null
fi
if deb-systemd-helper is-enabled imunify360-pam.service > /dev/null 2>&1; then
deb-systemd-helper disable imunify360-pam.service > /dev/null 2>&1 || :
fi
if deb-systemd-helper is-enabled imunify360-pam.socket > /dev/null 2>&1; then
deb-systemd-helper disable imunify360-pam.socket > /dev/null 2>&1 || :
fi
systemctl stop imunify360-pam.socket > /dev/null || true
systemctl stop imunify360-pam.service > /dev/null || true
# unplug dovecot module if panel is not directadmin
DIRECTADMIN_BIN=/usr/local/directadmin/directadmin
if [ ! -e ${DIRECTADMIN_BIN} ]; then
rm -f /lib64/dovecot/auth/lib_imunify360.so
fi
# fix "directory '/opt/i360_pam_imunify' not empty so not removed" warning
rm /opt/i360_pam_imunify/key || true
rm /opt/i360_pam_imunify/secret || true
fi
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0