#!/sbin/sh
#########################################################################
# 									
#   File:	 customize
#   @(#) customize $Revision: 1.4 $ $Date: 93/02/17 14:49:53 $
#   Description: /etc/update customization script for HPXT2-LPD fileset
# 
#########################################################################
#
umask 022
PATH="/bin:/usr/bin:/etc:."
FILESET=HPXT2-LPD


# Get environment variables as setup earlier in prerequisite fileset    
#
ENVARDIRS="/opt/hpxt/enware2/lbin /tmp /usr/tmp last"
for ENVARDIR in $ENVARDIRS
do
  if [ $ENVARDIR = "last" ]
  then
    echo "WARNING: cannot find suitable env.vars file"
  fi

  if [ -f $ENVARDIR/env.vars ]
  then
    . $ENVARDIR/env.vars
    break
  fi
done


if [ "$OS" = "hp10" ]
then

  if [ -f /usr/bin/dcnodes -o -f /usr/sbin/dcnodes ]
  then
    dcnodes -q
    if [ $? -eq 2 ]
    then
        exit 0
    fi
  fi

  PATH=$SW_PATH
fi

umask 22


#	
#	update directives with extension from this fileset
#	
if [ "x$NEWDIR" = "x" ]
then
  DIRECTIVES=${XTHOME}/bin/directives
else
  DIRECTIVES=${NEWDIR}/bin/directives
fi


egrep -i 'BEGIN LPD' ${DIRECTIVES} > /dev/null
if [ $? -ne 0 ]
then
  cat ${DIRECTIVES}.lpd >> ${DIRECTIVES}
fi

rm -f ${DIRECTIVES}.lpd

if [ "$OS" = "hp10" ]
then
  /opt/hpxt/enware2/lbin/xtutil_rm-file  ${DIRECTIVES}.lpd
fi

exit 0
