#! /bin/sh
set -e

reload_apache()
{
    if /usr/sbin/apache2ctl configtest 2>/dev/null; then
        invoke-rc.d apache2 force-reload || true
    else
        echo "Your apache2 configuration is broken, so we're not restarting it for you."
    fi
}

case "$1" in
    remove)
        if [ -e /etc/apache2/mods-enabled/uploader.load ]; then
	    a2dismod uploader >/dev/null || true
            reload_apache
	    fi
    ;;
    upgrade|failed-upgrade|deconfigure)
    ;;
    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
