summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/netif
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-07-30 17:19:35 +0000
committermtm <mtm@FreeBSD.org>2004-07-30 17:19:35 +0000
commitcc10a9c33b8fe66944273592dddfcaf73c9d0005 (patch)
tree5b3df6bc3177db80eac76e942831d4d30a88895b /etc/rc.d/netif
parent883988043400c9f44deb3cfba74345e361b61515 (diff)
downloadFreeBSD-src-cc10a9c33b8fe66944273592dddfcaf73c9d0005.zip
FreeBSD-src-cc10a9c33b8fe66944273592dddfcaf73c9d0005.tar.gz
Finish cleanup of rc.d/netif. It's now possible to start/stop more
than one interface from the command line: # /etc/rc.d/netif start bfe0 xl0 It's also possible to restart an interface(s): # /etc/rc.d/netif restart bfe0 This required some changes to rc.subr(8) so that if the start/stop commands are overidden the rest of the command line (after the start/stop/etc... cmd) is passed through to the subroutines.
Diffstat (limited to 'etc/rc.d/netif')
-rw-r--r--etc/rc.d/netif29
1 files changed, 19 insertions, 10 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index 63d45dd..44a1bfa 100644
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -42,6 +42,10 @@ _cmdifn=
network_start()
{
+ # Set the list of interfaces to work on.
+ #
+ _cmdifn=$*
+
if [ -z "$_cmdifn" ]; then
#
# We're operating as a general network start routine.
@@ -65,6 +69,10 @@ network_start()
network_stop()
{
+ # Set the list of interfaces to work on.
+ #
+ _cmdifn=$*
+
echo -n "Stopping network:"
# Deconfigure the interface(s)
@@ -96,12 +104,17 @@ network_common()
# Set the scope of the command (all interfaces or just one).
#
- _cooked_list="$_ifn_list"
+ _cooked_list=
if [ -n "$_cmdifn" ]; then
- eval _cooked_list=\"`expr "$_ifn_list" : ".*\($_cmdifn\).*"`\"
- if [ -z "$_cooked_list" ]; then
- err 1 "No such network interface: $_cmdifn"
- fi
+ for i in $_cmdifn ; do
+ eval _if=\"`expr "$_ifn_list" : ".*\(${i}\).*"`\"
+ if [ -z "$_if" ]; then
+ err 1 "No such network interface: $i"
+ fi
+ _cooked_list="$_cooked_list $_if"
+ done
+ else
+ _cooked_list="$_ifn_list"
fi
for ifn in ${_cooked_list}; do
@@ -159,9 +172,5 @@ ifn_stop()
return $cfg
}
-if [ -n "$2" ]; then
- _cmdifn="$2"
-fi
-
load_rc_config $name
-run_rc_command "$1"
+run_rc_command $*
OpenPOWER on IntegriCloud