#!/sbin/sh
#@(#)HP Netstation Admin Scripts
#
# rmbootpentry
#  Remove netstation specified in $1 from bootptab
#  Display the purged bootp table on stdout
#
#	RETURN values
#	  0  found (and removed)
#	  1  not found or table empty/not there
#

if [ ! -f $BOOTPTABLE ]
then
	exit 1
fi

egrep "^$1:" $BOOTPTABLE > /dev/null 2>&1
if [ $? -ne 0 ]
then
  cat $BOOTPTABLE
  exit 1
fi

if [ "$OS" = "hp10" ]
then
  echo "/^$1:/,/rfc1048\$/d" > $TMP/params
else
  echo "/^$1:/,/[^\]\$/d" > $TMP/params
fi

sed -f $TMP/params $BOOTPTABLE 
rm $TMP/params
exit 0
