RELOCATE=
if [ "$PKG_INSTALL_ROOT" != "" ]
then
    RELOCATE="-R $PKG_INSTALL_ROOT"
fi

PWENT=`/usr/bin/getent passwd svctag 2>/dev/null`
if [ $? -eq 0 ]; then
   PWUID=`echo $PWENT | awk -F: '{print $3}'`
   if [ "${PWUID}" -ne 95 ]; then
      /usr/sbin/userdel svctag  > /dev/null 2>&1
   fi
fi

# Get the basedir for the package.
#
PBASEDIR=`pkgparam $RELOCATE $PKGINST BASEDIR`
if [ "$PBASEDIR" = "" ]
then
    exit 1
fi

# Remove services

services_file=$BASEDIR/etc/inet/services
/bin/grep '^servicetag' ${services_file} >/dev/null 2>&1
if [ $? -eq 0 ]; then
   TMPSRV=/var/tmp/strmsvc.$$
   cat /etc/services | /bin/grep -v '^servicetag' > ${TMPSRV}
   cp ${TMPSRV} ${services_file}
   rm -f ${TMPSRV} >/dev/null 2>&1
fi

exit 0
