#!/bin/sh
set -e

DATADIR=/var/lib/bindgraph
CACHEDIR=/var/cache/bindgraph
DEFAULTS=/etc/default/bindgraph

case "$1" in
        purge)
		if [ -e /usr/share/debconf/confmodule ]; then
			. /usr/share/debconf/confmodule
			db_get bindgraph/stay_on_purge
			if [ "$RET" = "true" ]; then
				if [ -d $DATADIR ]; then rm -rf $DATADIR
				else rm -f $DATADIR/bindgraph.rrd
				fi
			fi
		fi
		rm -rf $CACHEDIR
		rm -f /etc/default/bindgraph
		rm -f /var/log/bind9-query.log
	;;

	remove)
		rm -rf $CACHEDIR
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
