#
# ident "@(#)postinstall 1.33 96/09/02 Copyright 09/02/96 SMI"
#
# postinstall script for pkgadd
# Add X.25 drivers and config files to the system

# NPCTE fix for bug 4024892, esc. 508197, SD, 10/07/97 
# Stops X.25 software before the X.25 drivers are removed.
#
# NPCTE fix for bug 4110533, SD, 07 Dec 99 - use of ${BASEDIR}
sh ${BASEDIR}/etc/init.d/snmpx25.control stop > ${BASEDIR}/tmp/status$$ 2>&1 
sh ${BASEDIR}/etc/init.d/x25.control status > ${BASEDIR}/tmp/status$$ 2>&1
net_status=`grep 'up' ${BASEDIR}/tmp/status$$`
if [ "$net_status" != "" ]; then
	sh ${BASEDIR}/etc/init.d/x25.control stop
fi
rm -f ${BASEDIR}/tmp/status$$

# see bug 1213641: TO allow jumpstart install to work
if [ "${BASEDIR:=/}" = "/" ]
then
        REM_DRV="rem_drv"
        ADD_DRV="add_drv"
else
        REM_DRV="rem_drv -b ${BASEDIR}"
        ADD_DRV="add_drv -b ${BASEDIR}"
fi
 
$REM_DRV ixe
$ADD_DRV -m '* 0666 root sys' ixe
# End NPCTE fix for bug 4110533

# end NPCTE fix for bug 4024892, esc. 508197, SD, 10/07/97


# NPCTE fix for bug 4330562, WP, 25 APR 00 - fix for bug 4063504 in
#					     the wrong script
# add the board definition for HSI-PCI board (on sparc only), bug 4063504
ARCH=`uname -p`
BOARDCONF_FILE=${BASEDIR}/etc/opt/SUNWconn/x25/boardconf
if [ x"$ARCH" = xsparc ]
then
  # check device path
  yet_def=`grep -w "device" $BOARDCONF_FILE | grep -w "hihp" | grep -w "dev"`
  if [ x"$yet_def" = x ] 
  then
    # check symbolic name
    yet_def=`grep -w "symbolic" $BOARDCONF_FILE | grep -w "HSIP"`
    if [ x"$yet_def" = x ] 
    then    
      echo "\nWAN_DEVICE" >> $BOARDCONF_FILE
      echo "\tsymbolic        HSIP" >> $BOARDCONF_FILE
      echo "\tdevice  /dev/hihp" >> $BOARDCONF_FILE
      echo "\tlines   4" >> $BOARDCONF_FILE
      echo "\tmru     1600" >> $BOARDCONF_FILE
      echo "\tcomment HSI 'Wide Area Network' board for PCI\n" >> $BOARDCONF_FILE
    fi
  fi   
fi

# End NPCTE fix for bug 4110533
# End NPCTE fix for bug 4330562
