#!/bin/sh
#
# $FreeBSD: ports/net-mgmt/flow-tools/files/pkg-deinstall.in,v 1.1 2006/11/08 01:06:16 stas Exp $
#

PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin

FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"

post-deinstall() {
	rmdir ${FLOW_CAPTURE_SPOOL} > /dev/null 2>&1
	if [ $? -ne 0 ]; then
		echo "WARNING: If you will NOT use this package anymore, please"
		echo " remove the following directory manually:"
		echo " ${FLOW_CAPTURE_SPOOL}"
		echo
		echo "Also flow-tools related user accounts and groups were not"
		echo "removed (${FLOW_CAPTURE_USER}:${FLOW_CAPTURE_GROUP})."
		echo "Do it manually, if needed."
		echo
	fi

#
# Remove pid directory
#
	rm -rf ${FLOW_CAPTURE_PIDDIR} > /dev/null 2>&1
}


case $2 in
	POST-DEINSTALL)
		post-deinstall
		;;
esac
