#!/bin/sh

set -e

if [ "$1" = "purge" ]
then
	# no debconf support, because templates are already gone
	#db_input medium htdig/remove-databases
	#db_go
	#db_get htdig/remove-databases

	echo -n "Do you want to remove the ht://Dig databases (y/n) [n] ?"
	read ans
	if [ "$ans" = "y" -o "$ans" = "Y" ]; then
		rm -rf /var/spool/htdig
		rm -rf /var/lib/htdig
	fi
fi

# Dirty do-not-hang-on-purge hack:
#NODEBHELPER#
