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-04 00:43:39 +08:00
|
|
|
|
2014-12-04 05:52:10 +08:00
|
|
|
if [ -e /usr/share/debconf/confmodule ]; then
|
|
|
|
|
|
|
|
# Source the debconf stuff
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
|
|
|
# Deconfigure the web server
|
|
|
|
db_get zoneminder/webserver
|
|
|
|
|
|
|
|
webservers="$RET"
|
|
|
|
for webserver in $webservers; do
|
|
|
|
webserver=${webserver%,}
|
|
|
|
# Currently we only support apache2
|
|
|
|
if [ "$webserver" = "apache2" ] ; then
|
|
|
|
apache_remove $1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2014-12-04 00:43:39 +08:00
|
|
|
|
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-12-04 00:43:39 +08:00
|
|
|
if [ "$1" = "purge" ]; then
|
2014-12-04 05:52:10 +08:00
|
|
|
|
2014-12-04 00:43:39 +08:00
|
|
|
# Delete a potential remaining file not managed by debhelper
|
|
|
|
rm -f /etc/zm/zm.conf.postinst.bak
|
|
|
|
fi
|
|
|
|
|
2014-11-26 05:09:55 +08:00
|
|
|
#DEBHELPER#
|
2014-12-03 21:12:26 +08:00
|
|
|
|
|
|
|
exit 0
|