1993-06-20 15:41:45 +02:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1995-03-21 16:20:48 +01:00
|
|
|
# $Id: netstart,v 1.21 1995/03/16 16:57:59 wollman Exp $
|
1993-11-07 02:19:06 +01:00
|
|
|
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
|
1993-06-20 15:41:45 +02:00
|
|
|
|
1993-07-19 23:08:53 +02:00
|
|
|
# my-name is my symbolic name
|
|
|
|
# my-netmask is specified in /etc/networks
|
1993-06-20 15:41:45 +02:00
|
|
|
#
|
1994-11-03 00:50:54 +01:00
|
|
|
if [ -z "`hostname -s`" ] ; then
|
|
|
|
hostname=`cat /etc/myname`
|
|
|
|
hostname $hostname
|
|
|
|
fi
|
1993-07-19 21:14:45 +02:00
|
|
|
|
1995-02-04 00:54:07 +01:00
|
|
|
# Set the domainname if we're using NIS
|
|
|
|
if [ -z "`domainname`" -a -e "/etc/defaultdomain" ] ; then
|
|
|
|
domainname=`cat /etc/defaultdomain`
|
|
|
|
domainname $domainname
|
|
|
|
fi
|
|
|
|
|
1994-09-15 03:19:43 +02:00
|
|
|
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
|
1993-06-20 15:41:45 +02:00
|
|
|
|
|
|
|
# set the address for the loopback interface
|
1993-07-19 21:14:45 +02:00
|
|
|
ifconfig lo0 inet localhost
|
1993-06-20 15:41:45 +02:00
|
|
|
|
1994-10-06 21:52:00 +01:00
|
|
|
# set interface for multicasts to default interface
|
|
|
|
# this needs to happen before router discovery
|
|
|
|
route add 224.0.0.0 -netmask 0xf0000000 -interface $hostname
|
|
|
|
|
1994-09-15 03:19:43 +02:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
|
|
|
route add default $defaultrouter
|
|
|
|
elif [ -f /etc/defaultrouter ] ; then
|
|
|
|
route add default `cat /etc/defaultrouter`
|
|
|
|
fi
|
|
|
|
|
1993-06-20 15:41:45 +02:00
|
|
|
# use loopback, not the wire
|
1993-07-19 23:08:53 +02:00
|
|
|
# route add $hostname localhost
|