#!/sbin/sh
#########################################################################
# 									
#   File:	 decustomize
#   @(#) decustomize $Revision: 1.4 $ $Date: 93/02/26 09:06:08 $
#   Description: /etc/update decustomization script for HPXT2-LPD fileset
# 
#########################################################################
#
# 

PATH="/bin:/usr/bin:/etc:."

FILESET=HPXT2-LPD


#-------------------------------------------------------------------#
# remove LPD lines from directives file
#-------------------------------------------------------------------#
#

if [ -f /opt/hpxt/enware2/lbin/env.vars ]
then
  . /opt/hpxt/enware2/lbin/env.vars
fi

if [ "x$XTHOME" = "x" ]
then
  XTHOME=/opt/hpxt/enware2/xthome
fi


if [ "x$NEWDIR" = "x" ]
then
  DIRECTIVES=${XTHOME}/bin/directives
else
  DIRECTIVES=${NEWDIR}/bin/directives
fi

if [ -f $DIRECTIVES ]
then
  sed '/BEGIN LPD/,/END LPD/d' $DIRECTIVES > $DIRECTIVES.new.$$
  if [ -s $DIRECTIVES.new.$$ ]
  then
    cmp -s $DIRECTIVES $DIRECTIVES.new.$$
    if [ $? -ne 0 ]
    then
      cp $DIRECTIVES $DIRECTIVES.orig.$$
      cp $DIRECTIVES.new.$$ $DIRECTIVES
    fi
  fi
fi

rm -f $DIRECTIVES.new.$$



exit 0
