Skip to contentSkip to conversation

update qemu-ifup for modern ip route output

PATCH Applied Dustin Kirkland 2 participants 2 messages Sep 17, 2009 – Sep 18, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 update qemu-ifup for modern ip route output

update qemu-ifup for modern ip route output

The output from the /sbin/ip utility has changed, adding two more columns, which breaks the qemu-ifup script, as it was depending on the last column being the interface name.

Change this from $NF to $5.

https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/430652

---
 kvm/scripts/qemu-ifup |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kvm/scripts/qemu-ifup +1 -1
index 3bf8801..284b176 100755
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
+switch=$(/sbin/ip route list | awk '/^default / { print $5 }')
 /sbin/ifconfig $1 0.0.0.0 up
 /usr/sbin/brctl addif ${switch} $1
Signature · 1 line
1.6.3.3
#1 lore raw

Applied, thanks.

Quoted 30 lines · Dustin Kirkland

update qemu-ifup for modern ip route output

The output from the /sbin/ip utility has changed, adding two more columns, which breaks the qemu-ifup script, as it was depending on the last column being the interface name.

Change this from $NF to $5.

https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/430652

---
 kvm/scripts/qemu-ifup |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kvm/scripts/qemu-ifup +1 -1
index 3bf8801..284b176 100755
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
+switch=$(/sbin/ip route list | awk '/^default / { print $5 }')
 /sbin/ifconfig $1 0.0.0.0 up
 /usr/sbin/brctl addif ${switch} $1
Signature · 1 line
1.6.3.3