#! /bin/sh

set -e

oldcachedir=/usr/share/mythtv/mythweb/image_cache
if [ "$1" = "upgrade" -a -d $oldcachedir ] && \
	dpkg --compare-versions "$2" lt 0.14-3; then
	# This became a symlink
	rmdir /usr/share/mythtv/mythweb/image_cache
fi

if [ ! -d /etc/apache2/conf-available ]; then
	mkdir -p /etc/apache2/conf-available
fi

if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
	. /usr/share/apache2/apache2-maintscript-helper
	apache2_invoke dissite mythwebdir
fi

if [ -f /etc/apache2/sites-available/mythwebdir ]; then
	mv /etc/apache2/sites-available/mythwebdir /etc/apache2/conf-available/mythweb.conf
fi

#DEBHELPER#

exit 0
