#!/bin/sh
set -e

. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/prerm.mysql
dbc_go mantis $@

# On package removal we need to delete the symlinks in www-root
if [ "$1" = 'remove' ]; then
	rm -f /usr/share/mantis/www/config_*.php
	
 	#just if database was removed whith dbconfig
	#we delete dbconfig-common mantis file
	#to preserve a clear new installation
	#help some miscorifuration like #546468
	
	if [ "$dbc_purge" = "true" ]; then
	
	  if [ -f /etc/dbconfig-common/mantis.conf ]; then
	    rm -f /etc/dbconfig-common/mantis.conf
	    if which ucf >/dev/null 2>&1; then
              ucf --purge /etc/dbconfig-common/mantis.conf 
	    fi
	  fi 
	
	fi
fi

#DEBHELPER#
