#!/bin/sh
#
# $FreeBSD: ports/irc/ptlink-services/pkg-install,v 1.2 2006/08/03 16:57:40 garga Exp $
#

case $2 in
POST-INSTALL)
	USER=ircd
	GROUP=ircd
	UID=72
	GID=72

	if pw groupshow "${GROUP}" > /dev/null 2>&1; then
	   echo "===> Using existing group ${GROUP}"
	else
	   echo "===> Adding group ${GROUP}"
	   pw groupadd ${GROUP} -g ${GID} || exit 1
	fi

	if pw usershow "${USER}" > /dev/null 2>&1; then
	   echo "===> Using existing user ${USER}"
	else
	   echo "===> Adding user ${USER}"
	   pw adduser ${USER} -u ${UID} -g ${GROUP} -h - -d "/nonexistent" \
	      -s "/nonexistent" -c "IRC daemon" || exit 1
	fi
	;;
esac


syntax highlighted by Code2HTML, v. 0.9.1