#!/bin/sh

set -e

case "$1" in
    remove)
        # Calling the init script during removal
	if [ -x "/etc/init.d/enable-nat" ] ; then
	    if [ -x "`which invoke-rc.d 2>/dev/null`" ] ; then
		invoke-rc.d enable-nat stop || exit $?
	    else
		/etc/init.d/enable-nat stop || exit $?
	    fi
	fi

        # Remove diverts before removing the package
	if [ remove = "$1" ] \
	    && [ -x /usr/sbin/debian-edu-ltsp-audiodivert ] ; then
	    debian-edu-ltsp-audiodivert remove
	fi
	;;
    purge)
	# Generated in the postinst
	rm -f /etc/default/enable-nat
	rm -f /etc/kde-user-profile
	rm -f /etc/kderc
	if [ ! -s /var/lib/dovecot/auth_success ] ; then
	    rm -f /var/lib/dovecot/auth_success
	fi
esac

#DEBHELPER#
