* usr/lib/byobu/ip_address, usr/lib/byobu/.shutil:

- add a get_default_interface function
  - something seems to have changed around the linux 3.0 kernel,
    in the order of /proc/net/dev; now test for 0.0.0.0 mask
This commit is contained in:
Dustin Kirkland 2011-07-28 00:14:38 -05:00
commit 995ccc9b76
3 changed files with 13 additions and 1 deletions

4
debian/changelog vendored
View file

@ -10,6 +10,10 @@ byobu (4.23) unreleased; urgency=low
- kill lingering byobu-statusd processes
* usr/lib/byobu/logo:
- revert whitespace required by statusd
* usr/lib/byobu/ip_address, usr/lib/byobu/.shutil:
- add a get_default_interface function
- something seems to have changed around the linux 3.0 kernel,
in the order of /proc/net/dev; now test for 0.0.0.0 mask
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 24 Jul 2011 14:23:38 -0500

View file

@ -270,4 +270,12 @@ get_now() {
fi
}
get_default_interface() {
local Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do
[ "$Mask" = "00000000" ] && break
done < /proc/net/route
_RET="$Iface"
}
# vi: syntax=sh ts=4 noexpandtab

View file

@ -33,7 +33,7 @@ __ip_address() {
else
case "$IPV6" in
1|true|yes) interface=$(awk '$10 != "lo" { iface=$10 ; }; END { print iface; }' /proc/net/ipv6_route);;
*) interface=$(awk 'END {print $1}' /proc/net/route);;
*) get_default_interface; interface="$_RET";;
esac
fi
case "$IPV6" in