#!/bin/sh
#
# $FreeBSD: ports/misc/dnetc/files/pkg-deinstall.in,v 1.1 2006/01/09 10:30:35 tdb Exp $

if [ "$2" != "POST-DEINSTALL" ]; then
    exit 0
fi

CLIENTUSER=dnetc
CLIENTGROUP=dnetc

if /usr/sbin/pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then
	if /usr/sbin/pw userdel -n $CLIENTUSER; then
		echo "=> Removed user \"$CLIENTUSER\"."
	else
		echo "=> Removing user \"$CLIENTUSER\" failed."
		exit 1
	fi
fi

if /usr/sbin/pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then
	if /usr/sbin/pw groupdel -n $CLIENTGROUP; then
		echo "=> Removed group \"$CLIENTGROUP\"."
	else
		echo "=> Removing group \"$CLIENTGROUP\" failed."
	exit 1
	fi
fi

exit 0
