File: /var/lib/dpkg/info/imunify360-webshield-bundle.preinst
#!/bin/sh
# preinst script for imunify360-webshield-bundle
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install)
getent group imunify360-webshield >/dev/null || groupadd -r imunify360-webshield
getent passwd imunify360-webshield >/dev/null || \
useradd -r -g imunify360-webshield -s /usr/sbin/nologin \
-d /var/cache/imunify360-webshield -c "imunify360-webshield user" imunify360-webshield
exit 0
;;
upgrade)
CONF_FILE="/etc/imunify360-webshield/whitelisted-domains.conf"
BACKUP_FILE="/etc/imunify360-webshield/whitelisted-domains.conf.imunify360-backup"
if [ -f "$CONF_FILE" ]; then
cp -v "$CONF_FILE" "$BACKUP_FILE"
fi
WSCHK=/etc/imunify360-webshield/wscheck.conf
if [ -d /usr/share/imunify360-webshield ]; then
if [ -e $WSCHK ]; then
cp $WSCHK /usr/share/imunify360-webshield/.wscheck.conf
fi
fi
# Saving user captcha customizations if any
mkdir -p /usr/share/imunify360-webshield/.captcha_mods
cp --preserve=timestamps /usr/share/imunify360-webshield/captcha/templates/head.tpl /usr/share/imunify360-webshield/.captcha_mods
cp --preserve=timestamps /usr/share/imunify360-webshield/captcha/templates/body.tpl /usr/share/imunify360-webshield/.captcha_mods
cp -r --preserve=timestamps /usr/share/imunify360-webshield/captcha/static /usr/share/imunify360-webshield/.captcha_mods
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
dpkg-maintscript-helper rm_conffile /etc/imunify360-webshield/webshield-http.conf.d/wscheck.conf 1.8-18 -- "$@"
fi
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
dpkg-maintscript-helper rm_conffile /etc/imunify360-webshield/webshield-http.conf.d/wsuserid.conf 1.7-5 -- "$@"
fi
;;
abort-upgrade)
;;
*)
echo "preinst 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