#! /bin/sh
# postrm script for condor

set -e

condor_user=condor


remove_condor_dirs() {
	# make an attempt to remove runtime data from the "standard" location
	# this cannot deal with non-standard LOCALDIR settings
	for dlabel in lib/condor spool/condor lock/condor log/condor run/condor; do
		dname="/var/$dlabel"
		if [ -d "$dname" ]; then
			rm -rf $dname
		fi
	done
}


case "$1" in
    remove|abort-install|disappear)
    ;;
    purge)
        # wipe out runtime data (logs, ...)
        remove_condor_dirs
        # not removing the condor system user; see http://bugs.debian.org/621833
        # for a discussion. also not trying to lock the condor user as it was
        # configured with --disabled-login --disabled-password already
    ;;
    upgrade|failed-upgrade|abort-upgrade)
    ;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

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

#DEBHELPER#

exit 0
