diff --git a/debian/changelog b/debian/changelog index ada4c72d..f795a892 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ byobu (5.13) unreleased; urgency=low usr/share/man/man1/byobu.1: LP: #929907 - disable the ec2_cost plugin if not running in EC2, allow override with EC2_ESTIMATE=1 in ~/.byobu/statusrc + * usr/lib/byobu/include/shutil: LP: #930656 + - support network interface detection on Mac OSX + - untested by me, but sort of suggested by a user -- Dustin Kirkland Thu, 16 Feb 2012 23:58:36 -0600 diff --git a/usr/lib/byobu/include/shutil b/usr/lib/byobu/include/shutil index 7d5b51e3..8a9639bf 100755 --- a/usr/lib/byobu/include/shutil +++ b/usr/lib/byobu/include/shutil @@ -292,13 +292,18 @@ get_now() { get_network_interface() { if [ -n "$MONITORED_NETWORK" ]; then + # Manual override _RET="$MONITORED_NETWORK" - else + elif [ -d /proc ]; then + # Linux systems, read route and interface from procfs 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" + else + # Mac OSX, shell out to the route command + _RET=$(/sbin/route get default|grep interface:|awk '{print $2}') fi }