diff options
author | sam <sam@FreeBSD.org> | 2008-04-20 20:37:21 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-04-20 20:37:21 +0000 |
commit | f481193ee59aca9435a3482d984bfb08608df56a (patch) | |
tree | f7b8568250777904a49cfd2118ba88164d8c111c /etc/rc.d/netif | |
parent | d7668145d4f9b614366d70f9a87179256cedfd8b (diff) | |
download | FreeBSD-src-f481193ee59aca9435a3482d984bfb08608df56a.zip FreeBSD-src-f481193ee59aca9435a3482d984bfb08608df56a.tar.gz |
rc support for vaps
Diffstat (limited to 'etc/rc.d/netif')
-rw-r--r-- | etc/rc.d/netif | 67 |
1 files changed, 9 insertions, 58 deletions
diff --git a/etc/rc.d/netif b/etc/rc.d/netif index 78cca61..8298da4 100644 --- a/etc/rc.d/netif +++ b/etc/rc.d/netif @@ -68,7 +68,7 @@ network_start() fi # Configure the interface(s). - network_common ifn_start verbose + network_common ifn_start if [ -f /etc/rc.d/ipfilter ] ; then # Resync ipfilter @@ -92,34 +92,31 @@ network_stop() echo '.' } -# network_common routine verbose +# network_common routine # Common configuration subroutine for network interfaces. This # routine takes all the preparatory steps needed for configuriing -# an interface and then calls $routine. If $verbose is specified, -# it will call ifconfig(8) to show, in long format, the configured -# interfaces. If $verbose is not given, it will simply output the -# configured interface(s). +# an interface and then calls $routine. network_common() { - local _cooked_list _fail _func _verbose + local _cooked_list _fail _func _func= - _verbose= if [ -z "$1" ]; then err 1 "network_common(): No function name specified." else _func="$1" fi - [ -n "$2" ] && _verbose=yes # Set the scope of the command (all interfaces or just one). # _cooked_list= if [ -n "$cmdifn" ]; then - # Don't check that the interfaces exist. We need to run + # Don't check that the interface(s) exist. We need to run # the down code even when the interface doesn't exist to # kill off wpa_supplicant. + # XXXBED: is this really true or does wpa_supplicant die? + # if so, we should get rid of the devd entry _cooked_list="$cmdifn" else _cooked_list="`list_net_interfaces`" @@ -127,59 +124,13 @@ network_common() _fail= for ifn in ${_cooked_list}; do - if ${_func} ${ifn} ; then - eval showstat_$ifn=1 - else - _fail="$_fail $ifn" + if ! ${_func} ${ifn} $2; then + _fail="${_fail} ${ifn}" fi done - # Display interfaces configured by this script - # - for ifn in ${_cooked_list}; do - eval showstat=\$showstat_${ifn} - if [ ! -z ${showstat} ]; then - if [ -n "$_verbose" ]; then - ifconfig ${ifn} - else - echo -n " ${ifn}" - fi - fi - done debug "The following interfaces were not configured: $_fail" } -ifn_start() -{ - local ifn cfg - ifn="$1" - cfg=1 - - [ -z "$ifn" ] && return 1 - - ifscript_up ${ifn} && cfg=0 - ifconfig_up ${ifn} && cfg=0 - ipv4_up ${ifn} && cfg=0 - ipx_up ${ifn} && cfg=0 - - return $cfg -} - -ifn_stop() -{ - local ifn cfg - ifn="$1" - cfg=1 - - [ -z "$ifn" ] && return 1 - - ipx_down ${ifn} && cfg=0 - ipv4_down ${ifn} && cfg=0 - ifconfig_down ${ifn} && cfg=0 - ifscript_down ${ifn} && cfg=0 - - return $cfg -} - load_rc_config $name run_rc_command $* |