#!/bin/sh
# postrm script for centrala

set -e

apache_remove() {
        COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)

        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
                . /usr/share/apache2/apache2-maintscript-helper
                apache2_invoke disconf centrala
        elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
                rm -f /etc/apache2/conf.d/centrala.conf
        fi

	rm -f /etc/apache2/conf-available/centrala.conf
}

if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
	apache_remove() $1
fi

exit 0
