#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2004/07/06 16:14:21 xsa Exp $

set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_FILE_DILLO=${SYSCONFDIR}/dillorc
CONFIG_FILE_DPID=${SYSCONFDIR}/dpidrc

do_notice()
{
    echo
    echo "+---------------"
    echo "| To completely deinstall the $1 package you need to perform"
    echo "| this step as root:"
    echo "|"
if [ -f ${CONFIG_FILE_DILLO} ]; then
    echo "|         rm -f ${CONFIG_FILE_DILLO}"
fi
if [ -f ${CONFIG_FILE_DPID} ]; then
    echo "|         rm -f ${CONFIG_FILE_DPID}"
fi
    echo "|"
    echo "| Do not do this if you plan on re-installing $1"
    echo "| at some future time."
    echo "+---------------"
    echo
}

# Verify proper execution
#
if [ $# -ne 2 ]; then
    echo "usage: $0 distname DEINSTALL" >&2
    exit 1
fi

# Verify/process the command
#
case $2 in
    DEINSTALL)
	if [ "$PKG_DELETE_EXTRA" != Yes ] && \
	   [ -f ${CONFIG_FILE_DILLO} -o -f ${CONFIG_FILE_DPID} ]; then
	    do_notice "$1"
	fi
	;;
    *)
	echo "usage: $0 distname DEINSTALL" >&2
	exit 1
	;;
esac

			
exit 0
