byobu-5.5: get_network_interface not working in Mac OSX

Bug #930656 reported by yegle on 2012-02-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dustin Kirkland 

Bug Description

get_network_interface() {
        if [ -n "$MONITORED_NETWORK" ]; then
        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

But there's no procfs support on Mac OSX thus this doesn't work in Mac OSX.

It's better to test if the current system has procfs support by determining if there's /proc directory.

yegle (cnyegle) wrote :

btw, this bug exists on the latest 6.7 too.

Dustin Kirkland  (kirkland) wrote :

Okay, thanks for the report.

As I don't have access to a Mac OSX system, can you propose some shell code that would do the equivalent of this on Mac? I'm happy to test and special case it, but I'll need working logic for OSX.


Changed in byobu:
importance: Undecided → Low
status: New → Incomplete
yegle (cnyegle) wrote :

This may works.

$ /sbin/route get default
   route to: default
destination: default
       mask: default
  interface: en1
 recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
       0 0 0 0 0 0 1500 0

$ /sbin/route get default|grep interface:|awk '{print $2}'

Manpage of OSX's BSD style /sbin/route command:

Dustin Kirkland  (kirkland) wrote :


Note that you can always manually set MONITORED_NETWORK in your ~/.byobu/statusrc to MONITORED_NETWORK=en1.

Dustin Kirkland  (kirkland) wrote :

Okay, committing something like this. Please give it a test. Thanks!

Changed in byobu:
status: Incomplete → In Progress
assignee: nobody → Dustin Kirkland (kirkland)
Dustin Kirkland  (kirkland) wrote :

Committed revision 1919. Will be in byobu-5.13.

Changed in byobu:
status: In Progress → Fix Committed
Changed in byobu:
status: Fix Committed → Triaged
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers