Localize $_punct_c in get_if_var() and whitespace clean-ups.
Based on: changes in r206408 by dougb
This commit is contained in:
parent
0a11003ea2
commit
462966ddac
@ -194,7 +194,7 @@ ifconfig_down()
|
||||
# $default if given.
|
||||
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
|
||||
err 3 'USAGE: get_if_var name var [default]'
|
||||
@ -505,7 +505,7 @@ ifexists()
|
||||
}
|
||||
|
||||
# ipv4_up if
|
||||
# add IPv4 addresses to the interface $if
|
||||
# add IPv4 addresses to the interface $if
|
||||
ipv4_up()
|
||||
{
|
||||
local _if _ret
|
||||
@ -615,14 +615,14 @@ ipv6_down()
|
||||
ipv4_addrs_common()
|
||||
{
|
||||
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
|
||||
_if=$1
|
||||
_action=$2
|
||||
|
||||
|
||||
# get ipv4-addresses
|
||||
cidr_addr=`get_if_var $_if ipv4_addrs_IF`
|
||||
|
||||
|
||||
for _cidr in ${cidr_addr}; do
|
||||
_ipaddr=${_cidr%%/*}
|
||||
_netmask="/"${_cidr##*/}
|
||||
@ -635,7 +635,7 @@ ipv4_addrs_common()
|
||||
if [ "${_action}" = "-alias" ]; then
|
||||
_netmask=""
|
||||
fi
|
||||
|
||||
|
||||
_ipcount=${_iplow}
|
||||
while [ "${_ipcount}" -le "${_iphigh}" ]; do
|
||||
eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"
|
||||
|
Loading…
Reference in New Issue
Block a user