#!/bin/sh
#
# Authors: Bas van der Vlies
#
# SVN Info:
#	$Id: postrm 87 2007-03-29 07:40:41Z bas $
#
DAEMON=pxeconfigd
CONFIG_FILE=/etc/pxeconfig.conf

if [ "$1" = "purge" ]
then
	/bin/rm $CONFIG_FILE

	PXE_TEST=`grep $DAEMON /etc/services`
	if [ ! -z "$PXE_TEST" ]
	then
		TMP_FILE=/tmp/services.$$
		grep -v "$DAEMON" /etc/services > $TMP_FILE
		mv $TMP_FILE /etc/services
	else
		echo "WARNING: no $DAEMON in /etc/services to remove"
	fi

	if [ -d /etc/xinetd.d ]
	then
		/bin/rm /etc/xinetd.d/$DAEMON
		/etc/init.d/xinetd reload
	else
		/usr/sbin/update-inetd --group OTHER --remove "$DAEMON stream  tcp  nowait  root.sys /usr/sbin/tcpd  /usr/sbin/$DAEMON"
		/etc/init.d/inetd reload
	fi   
fi
