gpodder.util: Fix FreeBSD network detection (bug 1730)

The unix_get_active_interfaces() function only partially works on
FreeBSD. Wireless interfaces do not have a status of "active", but
rather "associated".
This commit is contained in:
Wes Morgan 2013-12-07 12:54:51 +01:00 committed by Thomas Perl
parent 2008d44b4b
commit 2e6ea217dc

View file

@ -1685,7 +1685,7 @@ def osx_get_active_interfaces():
process = subprocess.Popen(['ifconfig'], stdout=subprocess.PIPE)
stdout, _ = process.communicate()
for i in re.split('\n(?!\t)', stdout, re.MULTILINE):
b = re.match('(\\w+):.*status: active$', i, re.MULTILINE | re.DOTALL)
b = re.match('(\\w+):.*status: (active|associated)$', i, re.MULTILINE | re.DOTALL)
if b:
yield b.group(1)