ia64/xen-unstable

changeset 9962:32444375fd3d

Fix code which finds the default interface if there are static routes.
The current code will break if there are multiple scope global routes
since the "ip route list default" command doesn't use "default" as a
filter, and will output multiple devices which breaks the rest of the
script.
Also make the vif/xenbr/eth naming consistent, i.e. if your default
network interface is eth1, you get vif1 and xenbr1.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon May 08 10:36:13 2006 +0100 (2006-05-08)
parents 1d2a0e2ef8f7
children a658da3a22dd
files tools/examples/network-bridge
line diff
     1.1 --- a/tools/examples/network-bridge	Sun May 07 21:41:36 2006 +0100
     1.2 +++ b/tools/examples/network-bridge	Mon May 08 10:36:13 2006 +0100
     1.3 @@ -59,9 +59,8 @@ dir=$(dirname "$0")
     1.4  findCommand "$@"
     1.5  evalVariables "$@"
     1.6  
     1.7 -vifnum=${vifnum:-0}
     1.8 +vifnum=${vifnum:-$(ip route list | awk '/^default / { sub(/eth/,"",$NF); print $NF }')}
     1.9  bridge=${bridge:-xenbr${vifnum}}
    1.10 -netdev=${netdev:-$(ip route list default scope global| awk '{ print $NF }')}
    1.11  netdev=${netdev:-eth${vifnum}}
    1.12  antispoof=${antispoof:-no}
    1.13