Added support for defaultrouter, both as a variable and as /etc/defaultrouter.

Changed the everlenghtening list of "if [ -f /etc/hostname.foo ].." to a
loop which will do them all, and look for init-scripts for them as well.
perfect place to put your calls to slattach and such: /etc/start_if.sl0
for instance.
This commit is contained in:
Poul-Henning Kamp 1994-09-15 01:19:43 +00:00
parent 01fa95f2b7
commit 9640f31c89
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2775

View File

@ -1,8 +1,9 @@
#!/bin/sh -
#
# $Id: netstart,v 1.11 1994/05/04 08:59:52 rgrimes Exp $
# $Id: netstart,v 1.12 1994/06/17 19:29:05 jkh Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
defaultrouter=NO
routedflags=-q
timedflags=NO
xntpdflags="NO"
@ -20,24 +21,26 @@ sendmail_flags="-bd -q30m"
hostname=`cat /etc/myname`
hostname $hostname
if [ -e /etc/hostname.ed0 ]; then
ifconfig ed0 `cat /etc/hostname.ed0`
fi
if [ -e /etc/hostname.ed1 ]; then
ifconfig ed1 `cat /etc/hostname.ed1`
fi
if [ -e /etc/hostname.ie0 ]; then
ifconfig ie0 `cat /etc/hostname.ie0`
fi
if [ -e /etc/hostname.is0 ]; then
ifconfig is0 `cat /etc/hostname.is0`
fi
if [ -e /etc/hostname.ze0 ]; then
ifconfig ze0 `cat /etc/hostname.ze0`
fi
for i in /etc/hostname.*
do
ifn=`expr $i : '/etc/hostname\.\(.*\)'`
if [ -e /etc/hostname.$ifn ]; then
if [ -e /etc/start_if.$ifn ]; then
sh /etc/start_if.$ifn $ifn
fi
ifconfig $ifn `cat /etc/hostname.$ifn`
ifconfig $ifn
fi
done
# set the address for the loopback interface
ifconfig lo0 inet localhost
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
route add default $defaultrouter
elif [ -f /etc/defaultrouter ] ; then
route add default `cat /etc/defaultrouter`
fi
# use loopback, not the wire
# route add $hostname localhost