better way to get ip address

Bug #2015819 reported by Bob Ballister
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
New
Undecided
Unassigned

Bug Description

On a server with multiple ips on different interfaces byobu may not show the best one.

I've found this method will get you the default outbound ip assuming you aren't using NAT. This way you don't have to specify an interface to get a reasonably good answer.

ipaddr=`ip -j route get 1.1.1.1 | python3 -c "import sys,json;j=json.load(sys.stdin);print(j[0]['prefsrc'])"`

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.