2014-11-26 05:09:55 +08:00
|
|
|
#! /bin/sh
|
2014-11-28 01:27:59 +08:00
|
|
|
|
|
|
|
set -e
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
|
|
|
|
apache_remove $1
|
|
|
|
if [ -f /etc/init.d/apache2 ] ; then
|
|
|
|
invoke-rc.d apache2 reload 3>/dev/null || true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-11-26 05:09:55 +08:00
|
|
|
if [ "$1" = "purge" ]; then
|
2014-11-29 04:36:11 +08:00
|
|
|
if [ -e "/etc/init.d/mysql" ]; then
|
|
|
|
echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
|
|
|
|
echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
|
|
|
|
mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm
|
|
|
|
else
|
|
|
|
echo 'mysql not found, assuming remote server.'
|
|
|
|
fi
|
2014-11-26 05:09:55 +08:00
|
|
|
fi
|
|
|
|
#DEBHELPER#
|