#!/sbin/sh

#########################################################################
# 									
#   File:	 customize
#   @(#) customize $Revision: 1.4 $ $Date: 93/02/17 14:50:13 $
#   Description: /etc/update customization script for HPXT2-UTILS fileset
# 
#########################################################################
#

umask 022
set -a
PATH="/bin:/usr/bin:/etc"
FILESET=HPXT2-UTILS


# 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"
    exit 0
  fi

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


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

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

fi


if [ "$OS" = "hp" ]
then
  ARCH=$1
  ARCHEXT=""
  case $ARCH in
    HP-MC68*)
	if [ ! hp9000s300 ]
	then
	    ARCHEXT="+/$ARCH"
	fi
	;;
  esac
fi

umask 22

# Update "directives" with extensions from this fileset
#

PARTS="utils"
for PART in $PARTS
do
  THISDIRECTIVE=$NEWDIR/bin/directives.$PART
  cat $NEWDIR/bin/directives | egrep -i directive | egrep -i "$PART" > /dev/null
  if [ $? -ne 0 ]
  then
    if [ -f $THISDIRECTIVE ]
    then
      cat $THISDIRECTIVE >> $NEWDIR/bin/directives
    else
      echo "WARNING: could not find $THISDIRECTIVE"
    fi
  fi
  rm  $THISDIRECTIVE
  /opt/hpxt/enware2/lbin/xtutil_rm-file $THISDIRECTIVE
done


exit 0
