#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1.1.1 2003/08/23 19:24:50 sturm Exp $
#
# De-installation setup of anacron

PATH=/bin:/usr/bin:/sbin:/usr/sbin
SPOOL_DIR=/var/spool/anacron

# Function: remove the anacron spool dir
do_spooldir()
{
    if [ "$PKG_DELETE_EXTRA" != Yes -a -d $SPOOL_DIR ]; then
	cat <<EOT
+----------
| Delete the $SPOOL_DIR spool directory manually for a full
| deinstallation.  To do this, execute 
|
|    rm -rf $SPOOL_DIR
|
| as root.
+----------

EOT
    fi
}

# Function: remove configurations
do_configs()
{
    if [ "$PKG_DELETE_EXTRA" != Yes -a -f ${SYSCONFDIR}/anacrontab ]; then
	cat <<EOT
+----------
| The existing ${SYSCONFDIR}/anacrontab has not been deleted.  To
| delete this file, execute 
|
|    rm ${SYSCONFDIR}/anacrontab
|
| as root.
+----------

EOT
    fi
}

do_notice()
{
    cat <<EOT
+----------
| Remember to restore any changes you made to root's crontab
| when installing anacron.
+----------

EOT
}

# Verify/process the command
#
case $2 in
    DEINSTALL)
	do_spooldir
	do_configs
	do_notice
	;;
    *)
	echo "Usage: `basename $0` distname DEINSTALL" >&2
	exit 1
	;;
esac

exit 0
