#! /bin/sh
# postrm script for root-daemon 
#
# see: dh_installdeb(1)

set -e

case "$1" in
    purge|abort-install)
	# Remove the rootd user and group 
	# Taken from mysql-server package and modified for ROOT 
        # rm -rf /var/spool/rootd
	userdel -r rootd
	reason=$?
        if [ $reason -ne 0 ] ; then 
	    # Could not remove user. Ignore. 
	    echo "Couldn't remove user rootd, check it. Reason"
	    case $reason in 
	    1)  echo "can't update password file"    ;;
	    2)  echo "bad command syntax"            ;;
	    6)  echo "specified user doesn't exist"  ;;
	    8)  echo "user currently logged in"      ;;
	    10) echo "can't update group file"       ;; 
	    12) echo "can't remove home directory"   ;;
	    *)  echo "Unknown"                       ;;
	    esac
	fi
	;;
    remove|upgrade|failed-upgrade|abort-upgrade|disappear)
	# Nothing to be done here 
        ;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 0

esac

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

#DEBHELPER#


