* Luca Tettamanti <[EMAIL PROTECTED]> [070404 01:15]: > Il Sun, Apr 01, 2007 at 09:24:21PM +0300, Baruch Even ha scritto: > > * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [070401 20:41]: > > > On my system the default route has both an explicit metric and a realm, > > > so it looks like this: > > > > > > default via 10.0.0.138 dev br0 metric 1 realm 10 > > > > > > Since the output of 'ip route ls' does not have a fixed format I suggest > > > to use the following awk program: > > > > > > switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if ($(i) > > > == "dev") print $(i+1) }}') > > > > > > which matches the default route and prints the field following the 'dev' > > > token (which is always the interface name). > > > > Thanks for the bug report and the fix! > > > > I'll put that in my repository and hope to upload another version with > > some other bug fixes, I'll also forward this to upstream from where this > > script came originally. > > Ah, I didn't noticed that it was 'qemu-ifup' renamed. > > Anyway I think that a more appropriate "fix" is getting the interface > name from a config file. > The user may want to use a different interface with e.g. VMs brigded on > the LAN (say br0 on eth0) and the default route on the WAN (eth1). > Furthermore more than one default route can be set, this will confuse > the script...
Indeed, this was discussed with upstream and I believe they will fix it properly at their end so everyone benefits. I will apply your fix to the next debian package as a temporary fix. Baruch -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]