home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
nwnet
/
root
/
usr
/
lib
/
netcfg
/
bin
/
ipx.sh
/
ipx
Wrap
Text File
|
1998-08-19
|
2KB
|
84 lines
# Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
#
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
# SANTA CRUZ OPERATION INC.
#
# The copyright notice above does not evidence any actual or intended
# publication of such source code.
#
# Copyright (C) 1997, The Santa Cruz Operation, Inc.
# All Rights Reserved.
#
# The information in this file is provided for the exclusive use of
# the licensees of The Santa Cruz Operation, Inc. Such users have the
# right to use, modify, and incorporate this code into other products
# for purposes authorized by the license agreement provided they include
# this notice and the associated copyright notice with any such product.
# The information in this file is provided "AS IS" without warranty.
#
#ident "@(#)ipx.sh 1.2"
#
#
# Generic routines used by the ipx/spx netconfig scripts
#
: ${OK=0} ${FAIL=1} ${RELINK=2} ${CANCEL=3}
PATH=/bin:/usr/bin:/etc:/etc/conf/bin:/usr/sbin:"$PATH"
##############################################################################
#
# Remove temp files and exit with the status passed as argument
#
# NWCONFIG=configuration directory to save
# $tmp
#
cleanup() {
trap '' 1 2 3 15
if [ $1 -eq $FAIL ]; then
for i in $NWCONFIG; do
[ -f $tmp$i ] && cp $tmp$i $i
done
fi
[ "$tmp" ] && rm -r -f $tmp*
rm -f $configfile
exit $1
}
##############################################################################
#
# Determine the media type(s) (ethernet, token-ring, etc.) and the interface
# type (DLPI+MDI or LLI) supported by the adapter. These variables are
# set by netcfg.
#
get_adapter_info() {
_media_types=${NETWORK_MEDIA:-"UNKNOWN"}
_interface=${DLPI_VERSION:-""}
if [ "$_media_types" = "" ] ; then
_media_types="UNKNOWN"
fi
if [ "$_interface" = "" ] ; then
_interface="LLI"
else
_interface="DLPI"
fi
}
##############################################################################
#
# Save the configuration for later emergency restoration
#
save_config() {
trap "" 1 2 3 15
for i in $NWCONFIG; do
dir=`dirname $i`
[ -d "$tmp$dir" ] || mkdir -p $tmp$dir
[ -f $i ] && cp $i $tmp$i
done
trap "cleanup $FAIL" 1 2 3 15
}