#! /bin/sh
# 
# prerm script for jwchat
#

set -e

configfile='/etc/jwchat/config.js'
apachefile='/etc/apache2/sites-available/jwchat'

case "$1" in
	remove)

	if [ -x /usr/sbin/a2dissite -a -x /etc/init.d/apache2 -a -L /etc/apache2/sites-enabled/jwchat ]; then
		a2dissite jwchat
		invoke-rc.d apache2 force-reload
	fi
	;;

	purge)
		
	if [ -x /usr/bin/ucf ] ; then 
		ucf --purge $configfile
		ucf --purge $apachefile
		rm -f $configfile $apachefile
	fi
	;;

	upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
	;;

	*)
	echo "prerm called with unknown argument \`$1'" >&2
	exit 1
	;;
esac

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

#DEBHELPER#

