#!/bin/ksh
#
# Copyright (c) 2004 by Sun Microsystems, Inc.
# All rights reserved
#
# "@(#)postbackout	1.2  04/08/24 SMI"
#
# restoring nettr.sh shell commands and variables, if the old driver is
# restored.
NETTR=$ROOTDIR/etc/opt/SUNWconn/trunking/bin/nettr.sh

# setup sed file
cat >/tmp/nettr.sed <<_DONE_
14a\\
BASEDIR=/etc//opt/SUNWconn/trunking\\
BINDIR=\$BASEDIR/bin\\
PATH\=\$PATH:$BINDIR\\
export PATH\\
echo Configuring Sun Trunking devices
_DONE_

if [ -f $NETTR ]; then
        # check if nettr.sh has already been modified
        grep "BASEDIR=" $NETTR >/dev/null 2>&1
        if [ ! $? -eq 0 ]; then #check if already modified, if so then restore

	   sed -f /tmp/nettr.sed $NETTR > /tmp/nettr.sh
                                                                                
           cp /tmp/nettr.sh $NETTR
        fi
fi

exit 0
