2014-12-16 19:42:51 +08:00
|
|
|
#! /bin/sh
|
2014-12-18 18:03:54 +08:00
|
|
|
# postrm maintainer script for zoneminder-core package
|
2014-12-16 19:42:51 +08:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Source the debconf stuff
|
|
|
|
if [ -f /usr/share/debconf/confmodule ]; then
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "purge" ]; then
|
|
|
|
|
|
|
|
# Ask the user if we have to remove the cache directory even if not empty
|
|
|
|
if [ -d /var/cache/zoneminder ] \
|
|
|
|
&& [ ! $(find /var/cache/zoneminder -maxdepth 0 -type d -empty 2>/dev/null) ]; then
|
|
|
|
RET=""
|
|
|
|
db_input high zoneminder/ask_delete || true
|
|
|
|
db_go || true
|
|
|
|
db_get zoneminder/ask_delete
|
|
|
|
if [ "$RET" = "true" ]; then
|
|
|
|
RET=""
|
|
|
|
db_input high zoneminder/ask_delete_again || true
|
|
|
|
db_go || true
|
|
|
|
db_get zoneminder/ask_delete_again
|
|
|
|
if [ "$RET" = "true" ]; then
|
|
|
|
rm -rf /var/cache/zoneminder
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
# postrm rm may freeze without that
|
|
|
|
db_stop
|
|
|
|
|
|
|
|
exit 0
|