DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T v

⟦08ae52379⟧ TextFile

    Length: 1282 (0x502)
    Types: TextFile
    Notes: @(#)vnconfig.sh 13.5 (RC International) 91/06/25
    Names: »vnconfig«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./etc/vnconfig« 

TextFile

#!	/bin/sh -e

#	@(#)vnconfig.sh	13.5 (RC International) 91/06/25


PU=`/bin/puname`
usage="echo Usage: $0 interface address-family address" > /dev/co_$PU

#
# Check parameters
#
case $# in
	3)  interface=$1;  family=$2;  address=$3;;	#OK
	*)  $usage; exit 1;;
esac

case $interface in
	vn[0-9]|en[0-7]);;				#OK
	*)  $usage; exit 2;;
esac

case $family in
	inet|ns);;					#OK
	*)  $usage; exit 3;;
esac

#
# If address is "hostname" we substitute with actual hostname
#
if test "$address" = hostname
then
	address=`/$PU/bin/hostname`
fi

#
# Get pid for the route daemon
#
getroutedpid() {
routedpid=`/$PU/bin/ps -B axn | /$PU/bin/awk '$5=="-routed" {print $1}'`;
}

#
# Initialize the software net and then broadcast this new
# route to other hosts and/or gateways
#
/$PU/etc/ifconfig $interface $family $address metric 1
getroutedpid
/$PU/bin/kill -7 $routedpid	# tell routed about the new configuration
/$PU/usr/bin/sleep 10
/$PU/etc/ifconfig $interface $family $address metric 2	# increase metric
getroutedpid
/$PU/bin/kill -7 $routedpid

#
# Actions to be performed on SIGHUP
#
trap '
	/$PU/etc/ifconfig $interface down
	getroutedpid
	/$PU/bin/kill -7 $routedpid
	exit 0
' 1

#
# Wait indefinitely for something to happen
# (presumably SIGHUP)
#
/$PU/usr/bin/sleep 2147483646