Localize $_punct_c in get_if_var() and whitespace clean-ups.
Based on: changes in r206408 by dougb
This commit is contained in:
parent
fa3b84643a
commit
95f15c1589
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212578
@ -194,7 +194,7 @@ ifconfig_down()
|
|||||||
# $default if given.
|
# $default if given.
|
||||||
get_if_var()
|
get_if_var()
|
||||||
{
|
{
|
||||||
local _if _punct _var _default prefix suffix
|
local _if _punct _punct_c _var _default prefix suffix
|
||||||
|
|
||||||
if [ $# -ne 2 -a $# -ne 3 ]; then
|
if [ $# -ne 2 -a $# -ne 3 ]; then
|
||||||
err 3 'USAGE: get_if_var name var [default]'
|
err 3 'USAGE: get_if_var name var [default]'
|
||||||
@ -505,7 +505,7 @@ ifexists()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ipv4_up if
|
# ipv4_up if
|
||||||
# add IPv4 addresses to the interface $if
|
# add IPv4 addresses to the interface $if
|
||||||
ipv4_up()
|
ipv4_up()
|
||||||
{
|
{
|
||||||
local _if _ret
|
local _if _ret
|
||||||
@ -615,14 +615,14 @@ ipv6_down()
|
|||||||
ipv4_addrs_common()
|
ipv4_addrs_common()
|
||||||
{
|
{
|
||||||
local _ret _if _action _cidr _cidr_addr
|
local _ret _if _action _cidr _cidr_addr
|
||||||
local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount
|
local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount
|
||||||
_ret=1
|
_ret=1
|
||||||
_if=$1
|
_if=$1
|
||||||
_action=$2
|
_action=$2
|
||||||
|
|
||||||
# get ipv4-addresses
|
# get ipv4-addresses
|
||||||
cidr_addr=`get_if_var $_if ipv4_addrs_IF`
|
cidr_addr=`get_if_var $_if ipv4_addrs_IF`
|
||||||
|
|
||||||
for _cidr in ${cidr_addr}; do
|
for _cidr in ${cidr_addr}; do
|
||||||
_ipaddr=${_cidr%%/*}
|
_ipaddr=${_cidr%%/*}
|
||||||
_netmask="/"${_cidr##*/}
|
_netmask="/"${_cidr##*/}
|
||||||
@ -635,7 +635,7 @@ ipv4_addrs_common()
|
|||||||
if [ "${_action}" = "-alias" ]; then
|
if [ "${_action}" = "-alias" ]; then
|
||||||
_netmask=""
|
_netmask=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_ipcount=${_iplow}
|
_ipcount=${_iplow}
|
||||||
while [ "${_ipcount}" -le "${_iphigh}" ]; do
|
while [ "${_ipcount}" -le "${_iphigh}" ]; do
|
||||||
eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"
|
eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"
|
||||||
|
Loading…
Reference in New Issue
Block a user