1993-06-20 13:41:45 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1996-02-11 04:07:27 +00:00
|
|
|
# $Id: netstart,v 1.41 1996/02/09 12:45:37 jkh Exp $
|
1993-11-07 01:19:06 +00:00
|
|
|
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
|
1993-06-20 13:41:45 +00:00
|
|
|
|
1995-05-11 21:11:17 +00:00
|
|
|
# Note that almost all the user-configurable behavior is no longer in
|
|
|
|
# this file, but rather in /etc/sysconfig. Please check this file
|
1995-05-17 04:46:57 +00:00
|
|
|
# first before contemplating any changes here. If you do need to change
|
|
|
|
# this file for some reason, we would like to know about it.
|
1995-05-11 21:11:17 +00:00
|
|
|
|
1995-04-11 01:22:24 +00:00
|
|
|
# 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
|
1994-11-02 23:50:54 +00:00
|
|
|
if [ -z "`hostname -s`" ] ; then
|
|
|
|
hostname $hostname
|
|
|
|
fi
|
1993-07-19 19:14:45 +00:00
|
|
|
|
1995-02-03 23:54:07 +00:00
|
|
|
# Set the domainname if we're using NIS
|
1995-04-24 23:52:16 +00:00
|
|
|
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
|
|
|
|
domainname $defaultdomainname
|
1995-02-03 23:54:07 +00:00
|
|
|
fi
|
|
|
|
|
1995-05-11 19:08:37 +00:00
|
|
|
#
|
|
|
|
# XXX This is known to cause an error if /usr is nfs mounted since it
|
1996-01-31 15:03:18 +00:00
|
|
|
# will not be available until after the network is up :-(. Once the
|
1995-05-11 19:08:37 +00:00
|
|
|
# relocation of sysctl to /sbin is done that problem will go away.
|
|
|
|
#
|
|
|
|
if [ -n "$tcp_extensions" -a "x$tcp_extensions" = "xNO" ] ; then
|
1995-06-25 09:35:56 +00:00
|
|
|
sysctl -w net.inet.tcp.rfc1323=0
|
|
|
|
sysctl -w net.inet.tcp.rfc1644=0
|
1995-05-11 19:08:37 +00:00
|
|
|
fi
|
|
|
|
|
1995-04-11 01:22:24 +00:00
|
|
|
# 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}
|
1994-09-15 01:19:43 +00:00
|
|
|
fi
|
1995-04-11 01:22:24 +00:00
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}
|
|
|
|
ifconfig ${ifn} ${ifconfig_args}
|
|
|
|
ifconfig ${ifn}
|
1994-09-15 01:19:43 +00:00
|
|
|
done
|
1993-06-20 13:41:45 +00:00
|
|
|
|
1994-09-15 01:19:43 +00:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
1995-05-17 04:46:57 +00:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
route_default="default ${defaultrouter}"
|
1994-09-15 01:19:43 +00:00
|
|
|
fi
|
|
|
|
|
1995-05-17 04:46:57 +00:00
|
|
|
# Set up any static routes. This should be done before router discovery.
|
1996-02-11 04:07:27 +00:00
|
|
|
if [ "x${static_routes}" != "x" ]; then
|
1996-02-09 12:45:38 +00:00
|
|
|
for i in ${static_routes}; do
|
|
|
|
eval route_args=\$route_${i}
|
|
|
|
route add ${route_args}
|
|
|
|
done
|
|
|
|
fi
|
1995-03-29 03:28:08 +00:00
|
|
|
|
1995-08-25 07:18:04 +00:00
|
|
|
if [ "x$gateway" != "xNO" ]; then
|
1995-08-23 07:12:16 +00:00
|
|
|
echo 'configuring host as a gateway.'
|
1996-01-02 19:47:05 +00:00
|
|
|
sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
|
1995-08-23 07:12:16 +00:00
|
|
|
fi
|
|
|
|
|
1996-01-06 20:49:18 +00:00
|
|
|
if [ "x$router" != "xNO" ] ; then
|
1995-12-28 01:24:04 +00:00
|
|
|
echo -n starting routing daemon:
|
1996-01-08 04:50:18 +00:00
|
|
|
echo -n " ${router}"; ${router} ${routerflags}
|
1995-04-09 09:54:51 +00:00
|
|
|
echo '.'
|
1995-03-29 03:28:08 +00:00
|
|
|
fi
|