summaryrefslogtreecommitdiffstats
path: root/etc/netstart
blob: af2e52a8fd1c419c76d7cc4fa34cdf9b29de54f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh -
#
#	$Id: netstart,v 1.24 1995/03/29 03:33:55 rgrimes Exp $
#	From: @(#)netstart	5.9 (Berkeley) 3/30/91

# my-name is my symbolic name
# my-netmask is specified in /etc/networks
#
if [ -z "`hostname -s`" ] ; then
	hostname $hostname
fi

# Set the domainname if we're using NIS
if [ -z "`domainname`" -a -e "/etc/defaultdomain" ] ; then
        domainname=`cat /etc/defaultdomain`
        domainname $domainname
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

# set interface for multicasts to default interface
# this needs to happen before router discovery
route add 224.0.0.0 -netmask 0xf0000000 -interface $hostname

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

if [ "x$gated" != "xNO" -o "x$routedflags" != "xNO" ] ; then
    echo -n starting routing daemons:

    # $gated and $routedflags are imported from /etc/sysconfig.
    # If $gated == YES, gated is used; otherwise routed.
    # If $routedflags == NO, routed isn't run.

    if [ "X${gated}" = X"YES" -a -r /etc/gated.conf ]; then
	    echo -n ' gated';	gated $gatedflags
    elif [ "X${routedflags}" != X"NO" ]; then
	    echo -n ' routed';	routed $routedflags
    fi

    echo '.'
fi
OpenPOWER on IntegriCloud