summaryrefslogtreecommitdiffstats
path: root/etc/netstart
blob: 9cdc1357a5bba2fe9fb0fa6020e572dea085a8c3 (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
62
63
64
65
66
67
68
#!/bin/sh -
#
#	$Id: netstart,v 1.41 1996/02/09 12:45:37 jkh Exp $
#	From: @(#)netstart	5.9 (Berkeley) 3/30/91

# Note that almost all the user-configurable behavior is no longer in
# this file, but rather in /etc/sysconfig.  Please check this file
# first before contemplating any changes here.  If you do need to change
# this file for some reason, we would like to know about it.

# If there is a global system configuration file, suck it in.
if [ -f /etc/sysconfig ]; then
	. /etc/sysconfig
fi

# Set the host name if it is not already set
if [ -z "`hostname -s`" ] ; then
	hostname $hostname
fi

# Set the domainname if we're using NIS
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
	domainname $defaultdomainname
fi

#
# XXX This is known to cause an error if /usr is nfs mounted since it
# will not be available until after the network is up :-(.  Once the
# relocation of sysctl to /sbin is done that problem will go away.
#
if [ -n "$tcp_extensions" -a "x$tcp_extensions" = "xNO" ] ; then
	sysctl -w net.inet.tcp.rfc1323=0
	sysctl -w net.inet.tcp.rfc1644=0
fi

# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
	if [ -e /etc/start_if.${ifn} ]; then
		. /etc/start_if.${ifn} ${ifn}
	fi
	eval ifconfig_args=\$ifconfig_${ifn}
	ifconfig ${ifn} ${ifconfig_args}
	ifconfig ${ifn}
done

if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
	static_routes="default ${static_routes}"
	route_default="default ${defaultrouter}"
fi

# Set up any static routes.  This should be done before router discovery.
if [ "x${static_routes}" != "x" ]; then
	for i in ${static_routes}; do
		eval route_args=\$route_${i}
		route add ${route_args}
	done
fi

if [ "x$gateway" != "xNO" ]; then
	echo 'configuring host as a gateway.'
	sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
fi

if [ "x$router" != "xNO" ] ; then
	echo -n starting routing daemon:
	echo -n " ${router}";	${router} ${routerflags}
	echo '.'
fi
OpenPOWER on IntegriCloud