From 9640f31c8916cfdf88a79d2ec4aa54a5d5b05262 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 15 Sep 1994 01:19:43 +0000 Subject: 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. --- etc/netstart | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'etc/netstart') diff --git a/etc/netstart b/etc/netstart index a953943a1f4e..a1c92677e9f3 100755 --- a/etc/netstart +++ b/etc/netstart @@ -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 -- cgit v1.2.3