diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1994-09-15 01:19:43 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1994-09-15 01:19:43 +0000 |
commit | 9640f31c8916cfdf88a79d2ec4aa54a5d5b05262 (patch) | |
tree | 905b79a6bf658d4bafa3ed24973dd896c45b3047 /etc | |
parent | 01fa95f2b7714fa0f6ce511ab64b22260e2894bc (diff) | |
download | src-9640f31c8916cfdf88a79d2ec4aa54a5d5b05262.tar.gz src-9640f31c8916cfdf88a79d2ec4aa54a5d5b05262.zip |
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.
Notes
Notes:
svn path=/head/; revision=2775
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/netstart | 35 |
1 files changed, 19 insertions, 16 deletions
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 |