#!/bin/sh
# postrm script for bit-cron
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    upgrade|failed-upgrade|abort-upgrade|abort-install)
        if [ -d /etc/bit-cron/ ]; then
            echo "****                                            ****"
            echo "****                                            ****"
            echo "**** YOU HAVE A (stale) /etc/bit-cron DIRECTORY ****"
            echo "****                                            ****"
            echo "****                                            ****"
            echo ""
            echo "Consider removing this directory. It should not be used anymore."
            sleep 2
        fi
    ;;

    purge)
        if [ -d /etc/bit-cron/ ]; then
            echo "Purging /etc/bit-cron directory"
            rm -rf -- /etc/bit-cron
        fi
        if [ -d /var/log/bit-cron/ ]; then
            echo "Purging /var/log/bit-cron directory"
            rm -rf -- /var/log/bit-cron
        fi
    ;;
    
    remove|disappear)
        echo "ok"
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

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

#DEBHELPER#

exit 0
