#!/bin/sh #ident "@(#)postinstall 1.8 05 Oct 1998 SMI" # #gshieh #exit code FAILURE=1 TMP=/tmp/nb.err NB=nb NBX=nbx TEMP=/tmp/${NB} KERNDRV=/kernel/drv NBHOMEETC=/etc/opt/SUNWlznb netbios=/etc/init.d/netbios FPROTOCOL=$NBHOMEETC/protocol GREP=/usr/bin/grep EXPR=/usr/bin/expr MV=/usr/bin/mv RM=/usr/bin/rm #*************************************************************************** # The following variables are defined: # REUSE - whether or not to use saved or current config. files #*************************************************************************** #*************************************************************************** # This function moves the configuration files, if existing, to the # NetBIOS home directory. If not existing, it gives the user a warning. #*************************************************************************** ReuseConfFiles() { PROMPT=y if [ \( "$HOST" = SUN \) \ -a -s $NBHOMEETC/protocol -a -s $NBHOMEETC/netbios.cf \ -a -s $NBHOMEETC/adapterId -a -s $NBHOMEETC/boards ]; then PROMPT=n fi if [ "$PROMPT" = y ]; then echo "\n***************************************************************************" echo "You have chosen to re-use the configuration files, but they are missing." echo "***************************************************************************" REUSE=no fi } # End of ReuseConfFiles #*************************************************************************** # This function removes the current or saved configuration files #*************************************************************************** RemoveConfFiles() { $RM -f $NBHOMEETC/adapterId >/dev/null 2>&1 $RM -f $NBHOMEETC/boards >/dev/null 2>&1 $RM -f $NBHOMEETC/netbios.cf >/dev/null 2>&1 $RM -f $NBHOMEETC/protocol >/dev/null 2>&1 } # End of RemoveConfFiles #*************************************************************************** # This function checks for $PKGASK values. If yes, then build a partial # protocol file (the hardware types will be filled in at the system boot # time). If no, then invoke autoconfig to build the protocol file. #*************************************************************************** #Bldprotocol() #{ #echo "All the configuration questions will be asked at \c" #echo "the system boot time." #/bin/sh /opt/SUNWlznb/sbin/autoconfig reconfig #} # # Start of POSTINSTALL script # cd $KERNDRV $GREP "name=nbx" /etc/devlink.tab >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo "type=ddi_pseudo;name=nbx;minor=nb nb" >> /etc/devlink.tab echo "type=ddi_pseudo;name=nbx;minor=nbdg nbdg">> /etc/devlink.tab echo "type=ddi_pseudo;name=nbx;minor=Xnb Xnb" >> /etc/devlink.tab echo "type=ddi_pseudo;name=nbx;minor=Xnbdg Xnbdg">> /etc/devlink.tab echo "nbx:* 0666 root sys" >> /etc/minor_perm fi # Added for installing pkg over itself /usr/sbin/modinfo | $GREP "nbx" >/dev/null 2>&1 if [ $? = 0 ]; then ps -ef | $GREP "nbdaemon" >/dev/null 2>&1 if [ $? = 0 ]; then /etc/init.d/netbios stop wait fi /usr/sbin/rem_drv nbx fi for DRV in nbx do echo "Installing ${NAME} ${DRV} driver ...." /usr/sbin/add_drv -v ${DRV} 2>> $TMP if [ $? != 0 ] then echo "The installation cannot be completed due \ to an error in the \ driver installation during the installation of the ${DRV} driver \ of the ${NAME}." $RM -f nbx nbx.conf exit $FAILURE fi done # Check for re-using the NetBIOS configuration files #if [ "$REUSE" = yes ]; then # REUSE and PKGASK might be changed if config files not found # ReuseConfFiles #fi cd / >/dev/null 2>&1 $RM -rf /tmp/nb >/dev/null 2>&1 #if [ "$REUSE" = no ]; then # RemoveConfFiles # remove the saved or current config files # Bldprotocol # build protocol file #fi /opt/SUNWlznb/sbin/defaultconfig /etc/init.d/netbios start