File: /var/lib/dpkg/info/imunify360-webshield-bundle.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
remove|upgrade|deconfigure)
if [ "$1" = remove ];then
# Remove webshield services from CSF
CSF_IGNORE_FILE=/etc/csf/csf.pignore
if [ -e $CSF_IGNORE_FILE ];then
for LINE in "exe:/usr/sbin/imunify360-webshield" "exe:/usr/sbin/wsshdict";do
sed -i -e "\|$LINE|d" $CSF_IGNORE_FILE
done
if which csf >/dev/null 2>&1; then
csf --restartall > /dev/null ||:
fi
fi
fi
# wafd
if [ "$1" = remove -o "$1" = purge ];then
/usr/share/imunify360-webshield/webshieldctl terminate || :
deb-systemd-invoke unmask imunify360-webshield || :
# fix "directory '/opt/i360_wafd_imunify' not empty so not removed" warning
rm -f /opt/i360_wafd_imunify/key || 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.
# Automatically added by dh_installinit/12.10ubuntu1
if [ -x "/etc/init.d/imunify360-webshield-ssl-cache" ]; then
invoke-rc.d imunify360-webshield-ssl-cache stop || exit 1
fi
# End automatically added section
# Automatically added by dh_installinit/12.10ubuntu1
if [ -x "/etc/init.d/imunify360-wafd" ]; then
invoke-rc.d imunify360-wafd stop || exit 1
fi
# End automatically added section
# Automatically added by dh_installinit/12.10ubuntu1
if [ -x "/etc/init.d/imunify360-webshield" ]; then
invoke-rc.d imunify360-webshield stop || exit 1
fi
# End automatically added section
# Automatically added by dh_systemd_start/12.10ubuntu1
if [ -d /run/systemd/system ]; then
deb-systemd-invoke stop 'imunify360-wafd.service' 'imunify360-webshield-ssl-cache.service' 'imunify360-webshield.service' >/dev/null || true
fi
# End automatically added section
exit 0