1993-06-20 15:41:45 +02:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1995-12-28 02:24:04 +01:00
|
|
|
# $Id: netstart,v 1.35 1995/08/25 07:18:04 davidg 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
|
|
|
|
1995-05-11 23:11:17 +02: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 06:46:57 +02: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 23:11:17 +02:00
|
|
|
|
1995-04-11 03:22:24 +02: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-03 00:50:54 +01:00
|
|
|
if [ -z "`hostname -s`" ] ; then
|
|
|
|
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
|
1995-04-25 01:52:16 +02:00
|
|
|
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
|
|
|
|
domainname $defaultdomainname
|
1995-02-04 00:54:07 +01:00
|
|
|
fi
|
|
|
|
|
1995-05-11 21:08:37 +02:00
|
|
|
#
|
|
|
|
# XXX This is known to cause an error if /usr is nfs mounted since it
|
|
|
|
# will not be avaliable 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
|
1995-06-25 11:35:56 +02:00
|
|
|
sysctl -w net.inet.tcp.rfc1323=0
|
|
|
|
sysctl -w net.inet.tcp.rfc1644=0
|
1995-05-11 21:08:37 +02:00
|
|
|
fi
|
|
|
|
|
1995-04-11 03:22:24 +02: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 03:19:43 +02:00
|
|
|
fi
|
1995-04-11 03:22:24 +02:00
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}
|
|
|
|
ifconfig ${ifn} ${ifconfig_args}
|
|
|
|
ifconfig ${ifn}
|
1994-09-15 03:19:43 +02:00
|
|
|
done
|
1993-06-20 15:41:45 +02:00
|
|
|
|
1994-09-15 03:19:43 +02:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
1995-05-17 06:46:57 +02:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
route_default="default ${defaultrouter}"
|
1994-09-15 03:19:43 +02:00
|
|
|
fi
|
|
|
|
|
1995-05-17 06:46:57 +02:00
|
|
|
# Set up any static routes. This should be done before router discovery.
|
|
|
|
for i in ${static_routes}; do
|
|
|
|
eval route_args=\$route_${i}
|
|
|
|
route add ${route_args}
|
|
|
|
done
|
1995-03-29 05:28:08 +02:00
|
|
|
|
1995-08-25 09:18:04 +02:00
|
|
|
if [ "x$gateway" != "xNO" ]; then
|
1995-08-23 09:12:16 +02:00
|
|
|
echo 'configuring host as a gateway.'
|
1995-12-28 02:24:04 +01:00
|
|
|
sysctl -w net.inet.ip.forwarding=1 >& /dev/null
|
1995-08-23 09:12:16 +02:00
|
|
|
fi
|
|
|
|
|
1995-12-28 02:24:04 +01:00
|
|
|
if [ "x$routedflags" != "xNO" ] ; then
|
|
|
|
echo -n starting routing daemon:
|
1995-03-29 05:33:55 +02:00
|
|
|
|
1995-12-28 02:24:04 +01:00
|
|
|
# $routedflags is imported from /etc/sysconfig.
|
1995-04-09 11:54:51 +02:00
|
|
|
# If $routedflags == NO, routed isn't run.
|
1995-03-29 05:28:08 +02:00
|
|
|
|
1995-12-28 02:24:04 +01:00
|
|
|
if [ "X${routedflags}" != X"NO" ]; then
|
1995-04-09 11:54:51 +02:00
|
|
|
echo -n ' routed'; routed $routedflags
|
|
|
|
fi
|
|
|
|
echo '.'
|
1995-03-29 05:28:08 +02:00
|
|
|
fi
|