#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.3 2004/04/14 08:07:14 xsa Exp $
#
# de-installation of amanda

set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
CONF_DIR=/etc/amanda

if [ $# -ne 2 -o "$2" != "DEINSTALL" ]; then
    echo "usage: $0 distname DEINSTALL" >&2
    exit 1
fi

if [ -d /var/amanda ]; then
   rm -rf /var/amanda
fi

# Don't actually do anything, but let the user know what can be
# done to fully de-install the package
#
if [ ${PKG_DELETE_EXTRA} != Yes -a -d $CONF_DIR ]; then
   echo ""
   echo "** The directory $CONF_DIR and any files within the directory"
   echo "** have not been removed.  You MAY want to remove these files to"
   echo "** completely remove the package."
fi
if grep -q -E ^amanda\|^amandaidx\|^amidxtape /etc/inetd.conf ; then
   echo ""
   echo "** Amanda should be removed from /etc/inetd.conf"
fi

exit 0
