summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1995-04-11 01:22:24 +0000
committerrgrimes <rgrimes@FreeBSD.org>1995-04-11 01:22:24 +0000
commit89c931f847614f418a1b635fba1ac76fc84c2262 (patch)
tree1cd6f01b294fa1df269b646e121a48f7ce1f88c0
parentf1537076e2271c9abaf52c7f34869dafc5fa39f3 (diff)
downloadFreeBSD-src-89c931f847614f418a1b635fba1ac76fc84c2262.zip
FreeBSD-src-89c931f847614f418a1b635fba1ac76fc84c2262.tar.gz
Remove obsolete comments about my-name and my-network.
Have netstart directly source sysconfig so that it stands on its own. Do not source netstart in rc, run it with sh. Rework the dangerous /etc/hostname.* so that it uses a variable with a list of interfaces and a variable for each interface in that list. The files /etc/hostname.* become obsolete with this change, the information is now stored in /etc/sysconfig. Source any /etc/start_if.${ifn} files so they can export things to netstart (plans for future enhancements in this area.) Obsolete /etc/defaultrouter, this is now down with $defaultrouter from sysconfig.
-rwxr-xr-xetc/netstart29
-rw-r--r--etc/rc4
-rw-r--r--etc/sysconfig12
3 files changed, 27 insertions, 18 deletions
diff --git a/etc/netstart b/etc/netstart
index 552ad58..9273799 100755
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,11 +1,14 @@
#!/bin/sh -
#
-# $Id: netstart,v 1.25 1995/03/30 06:26:08 rgrimes Exp $
+# $Id: netstart,v 1.26 1995/04/09 09:54:41 rgrimes Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
-# my-name is my symbolic name
-# my-netmask is specified in /etc/networks
-#
+# 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
@@ -16,16 +19,14 @@ if [ -z "`domainname`" -a -e "/etc/defaultdomain" ] ; then
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
+# 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
@@ -37,8 +38,6 @@ 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
diff --git a/etc/rc b/etc/rc
index 5bf24d1..7cd5bd5 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc,v 1.60 1995/03/30 06:26:09 rgrimes Exp $
+# $Id: rc,v 1.61 1995/04/09 09:54:42 rgrimes Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@@ -83,7 +83,7 @@ fi
# start up the network
if [ -f /etc/netstart ]; then
- . /etc/netstart
+ sh /etc/netstart
fi
mount -a -t nfs >/dev/null 2>&1 & # XXX shouldn't need background
diff --git a/etc/sysconfig b/etc/sysconfig
index ff78389..c0aac84 100644
--- a/etc/sysconfig
+++ b/etc/sysconfig
@@ -4,7 +4,7 @@
# This is sysconfig - a file full of useful variables that you can set
# to change the default startup behavior of your system.
#
-# $Id: sysconfig,v 1.8 1995/03/30 00:01:09 ache Exp $
+# $Id: sysconfig,v 1.9 1995/04/04 17:34:40 ache Exp $
######################### Start Of Syscons Section #######################
@@ -60,6 +60,16 @@ saver=NO
# Set to the name of your host - this is pretty important!
hostname=myname.my.domain
+# Set to the list of network devices on this host. You must have an
+# ifconfig_${network_interface} line for each interface listed here.
+# for example:
+#network_interfaces="ed0 sl0"
+
+# Set one for each network device listed in network_interfaces above.
+# for example:
+#ifconfig_ed0="inet 10.0.0.1 netmask 0xffffff00"
+#ifconfig_sl0="inet 10.0.1.0 netmask 0xffffff00"
+
# Set to the host you'd like set as your default router, or NO of none.
defaultrouter=NO
OpenPOWER on IntegriCloud