#!/bin/sh

case "$1" in
    configure)
        # continue below
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        exit 0
    ;;

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

/usr/sbin/update-rc.d anacron start 20 2 3 4 5 . >/dev/null

# Does /etc/crontab contain an entry to run anacron?
if grep -q -e '^[^#]*anacron' /etc/crontab; then
    # yes.

    echo
    echo "This version of the anacron package registers its cron job"
    echo "through the /etc/cron.d/anacron file. Therefore, your /etc/crontab"
    echo "file should _NOT_ contain a job to run anacron."
    echo
    echo "It's suggested that you remove this job."
    echo
    echo "Press <Return> to continue..."
    read ans
fi
