#!/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="/var/db/flows"
FLOW_CAPTURE_USER="flowtools"
FLOW_CAPTURE_GROUP="flowtools"
FLOW_CAPTURE_PIDDIR="/var/run/flow-capture"

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
