diff options
author | peter <peter@FreeBSD.org> | 1999-07-07 12:49:47 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-07-07 12:49:47 +0000 |
commit | cc2ae796a663ae5b86f355397761449afad634b8 (patch) | |
tree | 2eb20bcdc6afcbb17f1e97936fe5c91d10c06a64 /etc/rc.d/network3 | |
parent | 7c5b307ede57b5ff838abc0e5a4becdf9b9e5368 (diff) | |
download | FreeBSD-src-cc2ae796a663ae5b86f355397761449afad634b8.zip FreeBSD-src-cc2ae796a663ae5b86f355397761449afad634b8.tar.gz |
Do away with ${network_interfaces} in rc.conf. Just use `ifconfig -l` to
get a list of interfaces, and then automatically configure them if
${ifconfig_${ifn}} or /etc/start_if.${ifn} exists.
This makes it a lot easier to deal with machines that constantly change
their network configuration as you can leave ifconfig settings for all
the possible cards - just the ones that are present will be configured.
Diffstat (limited to 'etc/rc.d/network3')
-rw-r--r-- | etc/rc.d/network3 | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index 0a40acc..5f49696 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $ +# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -51,14 +51,18 @@ network_pass1() { done # Set up all the network interfaces, calling startup scripts if needed - for ifn in ${network_interfaces}; do + interfaces="`ifconfig -l`" + for ifn in ${interfaces}; do + showstat=false if [ -e /etc/start_if.${ifn} ]; then . /etc/start_if.${ifn} + showstat=true fi # Do the primary ifconfig if specified eval ifconfig_args=\$ifconfig_${ifn} if [ -n "${ifconfig_args}" ] ; then ifconfig ${ifn} ${ifconfig_args} + showstat=true fi # Check to see if aliases need to be added alias=0 @@ -67,6 +71,7 @@ network_pass1() { eval ifconfig_args=\$ifconfig_${ifn}_alias${alias} if [ -n "${ifconfig_args}" ]; then ifconfig ${ifn} ${ifconfig_args} alias + showstat=true alias=`expr ${alias} + 1` else break; @@ -76,8 +81,12 @@ network_pass1() { eval ifconfig_args=\$ifconfig_${ifn}_ipx if [ -n "${ifconfig_args}" ]; then ifconfig ${ifn} ${ifconfig_args} + showstat=true + fi + if [ "${showstat}" = "true" ] + then + ifconfig ${ifn} fi - ifconfig ${ifn} done # Initialize IP filtering using ipfw |