freebsd-dev/etc/netstart
Rodney W. Grimes a51ab5ce3b Reviewed by: wollman
Add a knob to make it easy to turn off RFC 1323 and RFC 1644 options.
1995-05-11 19:08:37 +00:00

70 lines
1.9 KiB
Bash
Executable File

#!/bin/sh -
#
# $Id: netstart,v 1.29 1995/04/24 23:52:15 rgrimes Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# 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 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
sysctl -nw net.inet.tcp.rfc1323=0
sysctl -nw 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
# 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
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'; /usr/local/sbin/gated $gatedflags
elif [ "X${routedflags}" != X"NO" ]; then
echo -n ' routed'; routed $routedflags
fi
echo '.'
fi