Browse code

Merge "Pick just the first route when looking for the host interface"

Jenkins authored on 2013/01/31 01:36:59
Showing 1 changed files
... ...
@@ -251,7 +251,7 @@ FIXED_NETWORK_SIZE=${FIXED_NETWORK_SIZE:-256}
251 251
 NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
252 252
 
253 253
 # Find the interface used for the default route
254
-HOST_IP_IFACE=${HOST_IP_IFACE:-$(ip route | sed -n '/^default/{ s/.*dev \(\w\+\)\s\+.*/\1/; p; }')}
254
+HOST_IP_IFACE=${HOST_IP_IFACE:-$(ip route | sed -n '/^default/{ s/.*dev \(\w\+\)\s\+.*/\1/; p; }' | head -1)}
255 255
 # Search for an IP unless an explicit is set by ``HOST_IP`` environment variable
256 256
 if [ -z "$HOST_IP" -o "$HOST_IP" == "dhcp" ]; then
257 257
     HOST_IP=""