summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-12-12 01:58:30 +0000
committerobrien <obrien@FreeBSD.org>1999-12-12 01:58:30 +0000
commite19cc0dd4faa046a35874be88336c0f17dab807c (patch)
treebac3042a7d566ff5063a336ddaa96480e2a28264 /etc/rc.d
parent9e84904436c91af26afdc6f643bed5b04969c820 (diff)
downloadFreeBSD-src-e19cc0dd4faa046a35874be88336c0f17dab807c.zip
FreeBSD-src-e19cc0dd4faa046a35874be88336c0f17dab807c.tar.gz
Suport multiple ``ifconfig_*?="DHCP"'' configurations.
Currently we have a problem in that `dhclient' bails when configuring the second interface as port 68 is already in use (by the `dhclient' started for the first interface). PR: 14810 Submitted by: n_hibma
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/netoptions30
-rw-r--r--etc/rc.d/network130
-rw-r--r--etc/rc.d/network230
-rw-r--r--etc/rc.d/network330
-rw-r--r--etc/rc.d/routing30
5 files changed, 95 insertions, 55 deletions
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index 72c7297..6985fd9 100644
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -77,11 +77,11 @@ network_pass1() {
;;
esac
+ dhcp_interfaces=""
for ifn in ${network_interfaces}; do
- showstat=false
if [ -r /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
- showstat=true
+ eval showstat_$ifn=1
fi
# Do the primary ifconfig if specified
@@ -92,15 +92,22 @@ network_pass1() {
'')
;;
[Dd][Hh][Cc][Pp])
- ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn}
- showstat=true
+ # DHCP inits are done all in one go below
+ dhcp_interfaces="$dhcp_interfaces $ifn"
+ eval showstat_$ifn=1
;;
*)
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
;;
esac
+ done
+
+ if [ ! -z "${dhcp_interfaces}" ]; then
+ ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
+ fi
+ for ifn in ${network_interfaces}; do
# Check to see if aliases need to be added
#
alias=0
@@ -108,7 +115,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
- showstat=true
+ eval showstat_$ifn=1
alias=`expr ${alias} + 1`
else
break;
@@ -120,14 +127,15 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
fi
+ done
- case ${showstat} in
- true)
+ for ifn in ${network_interfaces}; do
+ eval showstat=\$showstat_${ifn}
+ if [ ! -z ${showstat} ]; then
ifconfig ${ifn}
- ;;
- esac
+ fi
done
# Warm up user ppp if required, must happen before natd.
diff --git a/etc/rc.d/network1 b/etc/rc.d/network1
index 72c7297..6985fd9 100644
--- a/etc/rc.d/network1
+++ b/etc/rc.d/network1
@@ -77,11 +77,11 @@ network_pass1() {
;;
esac
+ dhcp_interfaces=""
for ifn in ${network_interfaces}; do
- showstat=false
if [ -r /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
- showstat=true
+ eval showstat_$ifn=1
fi
# Do the primary ifconfig if specified
@@ -92,15 +92,22 @@ network_pass1() {
'')
;;
[Dd][Hh][Cc][Pp])
- ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn}
- showstat=true
+ # DHCP inits are done all in one go below
+ dhcp_interfaces="$dhcp_interfaces $ifn"
+ eval showstat_$ifn=1
;;
*)
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
;;
esac
+ done
+
+ if [ ! -z "${dhcp_interfaces}" ]; then
+ ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
+ fi
+ for ifn in ${network_interfaces}; do
# Check to see if aliases need to be added
#
alias=0
@@ -108,7 +115,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
- showstat=true
+ eval showstat_$ifn=1
alias=`expr ${alias} + 1`
else
break;
@@ -120,14 +127,15 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
fi
+ done
- case ${showstat} in
- true)
+ for ifn in ${network_interfaces}; do
+ eval showstat=\$showstat_${ifn}
+ if [ ! -z ${showstat} ]; then
ifconfig ${ifn}
- ;;
- esac
+ fi
done
# Warm up user ppp if required, must happen before natd.
diff --git a/etc/rc.d/network2 b/etc/rc.d/network2
index 72c7297..6985fd9 100644
--- a/etc/rc.d/network2
+++ b/etc/rc.d/network2
@@ -77,11 +77,11 @@ network_pass1() {
;;
esac
+ dhcp_interfaces=""
for ifn in ${network_interfaces}; do
- showstat=false
if [ -r /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
- showstat=true
+ eval showstat_$ifn=1
fi
# Do the primary ifconfig if specified
@@ -92,15 +92,22 @@ network_pass1() {
'')
;;
[Dd][Hh][Cc][Pp])
- ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn}
- showstat=true
+ # DHCP inits are done all in one go below
+ dhcp_interfaces="$dhcp_interfaces $ifn"
+ eval showstat_$ifn=1
;;
*)
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
;;
esac
+ done
+
+ if [ ! -z "${dhcp_interfaces}" ]; then
+ ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
+ fi
+ for ifn in ${network_interfaces}; do
# Check to see if aliases need to be added
#
alias=0
@@ -108,7 +115,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
- showstat=true
+ eval showstat_$ifn=1
alias=`expr ${alias} + 1`
else
break;
@@ -120,14 +127,15 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
fi
+ done
- case ${showstat} in
- true)
+ for ifn in ${network_interfaces}; do
+ eval showstat=\$showstat_${ifn}
+ if [ ! -z ${showstat} ]; then
ifconfig ${ifn}
- ;;
- esac
+ fi
done
# Warm up user ppp if required, must happen before natd.
diff --git a/etc/rc.d/network3 b/etc/rc.d/network3
index 72c7297..6985fd9 100644
--- a/etc/rc.d/network3
+++ b/etc/rc.d/network3
@@ -77,11 +77,11 @@ network_pass1() {
;;
esac
+ dhcp_interfaces=""
for ifn in ${network_interfaces}; do
- showstat=false
if [ -r /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
- showstat=true
+ eval showstat_$ifn=1
fi
# Do the primary ifconfig if specified
@@ -92,15 +92,22 @@ network_pass1() {
'')
;;
[Dd][Hh][Cc][Pp])
- ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn}
- showstat=true
+ # DHCP inits are done all in one go below
+ dhcp_interfaces="$dhcp_interfaces $ifn"
+ eval showstat_$ifn=1
;;
*)
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
;;
esac
+ done
+
+ if [ ! -z "${dhcp_interfaces}" ]; then
+ ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
+ fi
+ for ifn in ${network_interfaces}; do
# Check to see if aliases need to be added
#
alias=0
@@ -108,7 +115,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
- showstat=true
+ eval showstat_$ifn=1
alias=`expr ${alias} + 1`
else
break;
@@ -120,14 +127,15 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
fi
+ done
- case ${showstat} in
- true)
+ for ifn in ${network_interfaces}; do
+ eval showstat=\$showstat_${ifn}
+ if [ ! -z ${showstat} ]; then
ifconfig ${ifn}
- ;;
- esac
+ fi
done
# Warm up user ppp if required, must happen before natd.
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index 72c7297..6985fd9 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -77,11 +77,11 @@ network_pass1() {
;;
esac
+ dhcp_interfaces=""
for ifn in ${network_interfaces}; do
- showstat=false
if [ -r /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
- showstat=true
+ eval showstat_$ifn=1
fi
# Do the primary ifconfig if specified
@@ -92,15 +92,22 @@ network_pass1() {
'')
;;
[Dd][Hh][Cc][Pp])
- ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${ifn}
- showstat=true
+ # DHCP inits are done all in one go below
+ dhcp_interfaces="$dhcp_interfaces $ifn"
+ eval showstat_$ifn=1
;;
*)
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
;;
esac
+ done
+
+ if [ ! -z "${dhcp_interfaces}" ]; then
+ ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
+ fi
+ for ifn in ${network_interfaces}; do
# Check to see if aliases need to be added
#
alias=0
@@ -108,7 +115,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
- showstat=true
+ eval showstat_$ifn=1
alias=`expr ${alias} + 1`
else
break;
@@ -120,14 +127,15 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
- showstat=true
+ eval showstat_$ifn=1
fi
+ done
- case ${showstat} in
- true)
+ for ifn in ${network_interfaces}; do
+ eval showstat=\$showstat_${ifn}
+ if [ ! -z ${showstat} ]; then
ifconfig ${ifn}
- ;;
- esac
+ fi
done
# Warm up user ppp if required, must happen before natd.
OpenPOWER on IntegriCloud