/[vps]/baselayout-vserver/trunk/net-scripts/net.modules.d/ifconfig
Gentoo

Diff of /baselayout-vserver/trunk/net-scripts/net.modules.d/ifconfig

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 235 Revision 236
388 [[ ${r} != "0" ]] && return ${r} 388 [[ ${r} != "0" ]] && return ${r}
389 389
390 local metric ifvar=$(bash_variable "${real_iface}") 390 local metric ifvar=$(bash_variable "${real_iface}")
391 # Remove the newly added route and replace with our metric 391 # Remove the newly added route and replace with our metric
392 metric="metric_${ifvar}" 392 metric="metric_${ifvar}"
393 [[ ${!metric} == "0" || ${RC_AUTO_INTERFACE} != "yes" ]] && return ${r} 393 [[ ${!metric:-0} == "0" ]] && return ${r}
394 394
395 if [[ -z ${netmask} ]]; then 395 if [[ -z ${netmask} ]]; then
396 for (( i=1; i<${#config[@]}-1; i++ )); do 396 for (( i=1; i<${#config[@]}-1; i++ )); do
397 if [[ ${config[i]} == "netmask" ]]; then 397 if [[ ${config[i]} == "netmask" ]]; then
398 netmask="${config[i+1]}" 398 netmask="${config[i+1]}"
405 405
406 local network=$( ip_network "${ip}" "${netmask}" ) 406 local network=$( ip_network "${ip}" "${netmask}" )
407 407
408 if route del -net "${network}/${cidr}" metric 0 dev "${iface}" \ 408 if route del -net "${network}/${cidr}" metric 0 dev "${iface}" \
409 2>/dev/null ; then 409 2>/dev/null ; then
410 route add -net "${network}/${cidr}" metric "${!metric}" dev "${iface}" 410 route add -net "${network}/${cidr}" metric "${!metric:-0}" dev "${iface}"
411 fi 411 fi
412 412
413 return ${r} 413 return ${r}
414} 414}
415 415

Legend:
Removed from v.235  
changed lines
  Added in v.236

  ViewVC Help
Powered by ViewVC 1.1.20