mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
* 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:
parent
a38cf035ee
commit
995ccc9b76
3 changed files with 13 additions and 1 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -10,6 +10,10 @@ byobu (4.23) unreleased; urgency=low
|
||||||
- kill lingering byobu-statusd processes
|
- kill lingering byobu-statusd processes
|
||||||
* usr/lib/byobu/logo:
|
* usr/lib/byobu/logo:
|
||||||
- revert whitespace required by statusd
|
- 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
|
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 24 Jul 2011 14:23:38 -0500
|
||||||
|
|
||||||
|
|
|
@ -270,4 +270,12 @@ get_now() {
|
||||||
fi
|
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
|
# vi: syntax=sh ts=4 noexpandtab
|
||||||
|
|
|
@ -33,7 +33,7 @@ __ip_address() {
|
||||||
else
|
else
|
||||||
case "$IPV6" in
|
case "$IPV6" in
|
||||||
1|true|yes) interface=$(awk '$10 != "lo" { iface=$10 ; }; END { print iface; }' /proc/net/ipv6_route);;
|
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
|
esac
|
||||||
fi
|
fi
|
||||||
case "$IPV6" in
|
case "$IPV6" in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue