netif (128714) | netif (129492) |
---|---|
1#!/bin/sh 2# 3# Copyright (c) 2003 The FreeBSD Project. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17# IN NO EVENT SHALL THE PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, 18# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24# | 1#!/bin/sh 2# 3# Copyright (c) 2003 The FreeBSD Project. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 8 unchanged lines hidden (view full) --- 17# IN NO EVENT SHALL THE PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, 18# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24# |
25# $FreeBSD: head/etc/rc.d/netif 128714 2004-04-28 13:20:15Z phk $ | 25# $FreeBSD: head/etc/rc.d/netif 129492 2004-05-20 14:16:05Z mtm $ |
26# 27 28# PROVIDE: netif 29# REQUIRE: atm1 ipfilter mountcritlocal pccard serial sppp sysctl 30# KEYWORD: FreeBSD nojail 31 32. /etc/rc.subr 33. /etc/network.subr --- 46 unchanged lines hidden (view full) --- 80# interfaces. If $verbose is not given, it will simply output the 81# configured interface(s). 82network_common() 83{ 84 _func= 85 _verbose= 86 87 if [ -z "$1" ]; then | 26# 27 28# PROVIDE: netif 29# REQUIRE: atm1 ipfilter mountcritlocal pccard serial sppp sysctl 30# KEYWORD: FreeBSD nojail 31 32. /etc/rc.subr 33. /etc/network.subr --- 46 unchanged lines hidden (view full) --- 80# interfaces. If $verbose is not given, it will simply output the 81# configured interface(s). 82network_common() 83{ 84 _func= 85 _verbose= 86 87 if [ -z "$1" ]; then |
88 err "network_common(): No function name specified." | 88 err 1 "network_common(): No function name specified." |
89 else 90 _func="$1" 91 fi 92 [ -n "$2" ] && _verbose=yes 93 94 # Get a list of network interfaces. Do not include dhcp interfaces. 95 _ifn_list="`list_net_interfaces nodhcp`" 96 97 # Set the scope of the command (all interfaces or just one). 98 # 99 _cooked_list="$_ifn_list" 100 if [ -n "$_cmdifn" ]; then 101 eval _cooked_list=\"`expr "$_ifn_list" : ".*\($_cmdifn\).*"`\" 102 if [ -z "$_cooked_list" ]; then | 89 else 90 _func="$1" 91 fi 92 [ -n "$2" ] && _verbose=yes 93 94 # Get a list of network interfaces. Do not include dhcp interfaces. 95 _ifn_list="`list_net_interfaces nodhcp`" 96 97 # Set the scope of the command (all interfaces or just one). 98 # 99 _cooked_list="$_ifn_list" 100 if [ -n "$_cmdifn" ]; then 101 eval _cooked_list=\"`expr "$_ifn_list" : ".*\($_cmdifn\).*"`\" 102 if [ -z "$_cooked_list" ]; then |
103 err "No such network interface: $_cmdifn" | 103 err 1 "No such network interface: $_cmdifn" |
104 return 1 105 fi 106 fi 107 108 for ifn in ${_cooked_list}; do 109 if ${_func} ${ifn} ; then 110 eval showstat_$ifn=1 111 else --- 57 unchanged lines hidden --- | 104 return 1 105 fi 106 fi 107 108 for ifn in ${_cooked_list}; do 109 if ${_func} ${ifn} ; then 110 eval showstat_$ifn=1 111 else --- 57 unchanged lines hidden --- |