summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-06-23 20:50:11 +0000
committermtm <mtm@FreeBSD.org>2008-06-23 20:50:11 +0000
commitebef621a5c0d1fa0503febee26676d0844ab24a3 (patch)
tree35e85abf7532288a30c2f648031caa7df68cfbbf /etc/rc.d
parent24cfc8496479cf1dd0d9705cc8c7caa9002ba3db (diff)
downloadFreeBSD-src-ebef621a5c0d1fa0503febee26676d0844ab24a3.zip
FreeBSD-src-ebef621a5c0d1fa0503febee26676d0844ab24a3.tar.gz
Implement a "quiet" mode for rc.d/netif, which only outputs
the interface name of interfaces that were configured. This change has the added benefit that ifn_start() and ifn_stop() in network.subr no longer write to standard output. Whether to output and what to output is now handled entirely in rc.d/netif.
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/netif26
1 files changed, 21 insertions, 5 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif
index 8298da4..666bec8 100644
--- a/etc/rc.d/netif
+++ b/etc/rc.d/netif
@@ -85,11 +85,8 @@ network_stop()
#
cmdifn=$*
- echo -n "Stopping network:"
-
# Deconfigure the interface(s)
network_common ifn_stop
- echo '.'
}
# network_common routine
@@ -98,7 +95,7 @@ network_stop()
# an interface and then calls $routine.
network_common()
{
- local _cooked_list _fail _func
+ local _cooked_list _fail _func _ok _str
_func=
@@ -123,12 +120,31 @@ network_common()
fi
_fail=
+ _ok=
for ifn in ${_cooked_list}; do
- if ! ${_func} ${ifn} $2; then
+ if ${_func} ${ifn} $2; then
+ _ok="${_ok} ${ifn}"
+ else
_fail="${_fail} ${ifn}"
fi
done
+ _str=
+ if [ -n "${_ok}" ]; then
+ case ${_func} in
+ ifn_start)
+ _str='Starting'
+ ;;
+ ifn_stop)
+ _str='Stopping'
+ ;;
+ esac
+ echo "${_str} Network:${_ok}."
+ if [ -z "${rc_quiet}" ]; then
+ /sbin/ifconfig ${_ok}
+ fi
+ fi
+
debug "The following interfaces were not configured: $_fail"
}
OpenPOWER on IntegriCloud