2014-11-26 05:09:55 +08:00
|
|
|
#! /bin/sh
|
2014-11-28 01:27:59 +08:00
|
|
|
|
2014-12-03 21:12:26 +08:00
|
|
|
set -x
|
2014-11-26 05:09:55 +08:00
|
|
|
|
2014-11-29 00:46:37 +08:00
|
|
|
apache_remove() {
|
|
|
|
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
|
|
|
|
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
|
|
|
|
. /usr/share/apache2/apache2-maintscript-helper
|
|
|
|
apache2_invoke disconf zoneminder
|
|
|
|
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
|
|
|
|
rm -f /etc/apache2/conf.d/zoneminder.conf
|
|
|
|
fi
|
|
|
|
rm -f /etc/apache2/conf-available/zoneminder.conf
|
2014-12-03 21:12:26 +08:00
|
|
|
# Reload the web server
|
|
|
|
deb-systemd-invoke reload apache2.service || true
|
2014-11-29 00:46:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
|
2014-12-03 21:12:26 +08:00
|
|
|
# Deconfigure the web server
|
2014-11-29 00:46:37 +08:00
|
|
|
apache_remove $1
|
2014-12-03 21:12:26 +08:00
|
|
|
# No need to manually remove the zm database and user, dbconfig take care of this
|
2014-11-29 00:46:37 +08:00
|
|
|
fi
|
|
|
|
|
2014-11-26 05:09:55 +08:00
|
|
|
#DEBHELPER#
|
2014-12-03 21:12:26 +08:00
|
|
|
|
|
|
|
exit 0
|