Merge pull request #376 from TheEdgeOfRage/master
Detect wireguard interfaces as tunnel type
This commit is contained in:
commit
62d34395c7
1 changed files with 4 additions and 4 deletions
|
@ -63,7 +63,7 @@ class Module(bumblebee.engine.Module):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _istunnel(self, intf):
|
def _istunnel(self, intf):
|
||||||
return intf.startswith("tun")
|
return intf.startswith("tun") or intf.startswith("wg")
|
||||||
|
|
||||||
def get_addresses(self, intf):
|
def get_addresses(self, intf):
|
||||||
retval = []
|
retval = []
|
||||||
|
@ -74,7 +74,7 @@ class Module(bumblebee.engine.Module):
|
||||||
except Exception:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
def _update_widgets(self, widgets):
|
def _update_widgets(self, widgets):
|
||||||
interfaces = [i for i in netifaces.interfaces() if not i.startswith(self._exclude)]
|
interfaces = [i for i in netifaces.interfaces() if not i.startswith(self._exclude)]
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class Module(bumblebee.engine.Module):
|
||||||
|
|
||||||
if len(self._states["exclude"]) > 0 and state in self._states["exclude"]: continue
|
if len(self._states["exclude"]) > 0 and state in self._states["exclude"]: continue
|
||||||
if len(self._states["include"]) > 0 and state not in self._states["include"]: continue
|
if len(self._states["include"]) > 0 and state not in self._states["include"]: continue
|
||||||
|
|
||||||
widget = self.widget(intf)
|
widget = self.widget(intf)
|
||||||
if not widget:
|
if not widget:
|
||||||
widget = bumblebee.output.Widget(name=intf)
|
widget = bumblebee.output.Widget(name=intf)
|
||||||
|
@ -104,7 +104,7 @@ class Module(bumblebee.engine.Module):
|
||||||
for widget in widgets:
|
for widget in widgets:
|
||||||
if widget.get("visited") is False:
|
if widget.get("visited") is False:
|
||||||
widgets.remove(widget)
|
widgets.remove(widget)
|
||||||
|
|
||||||
def get_ssid(self, intf):
|
def get_ssid(self, intf):
|
||||||
if self._iswlan(intf):
|
if self._iswlan(intf):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue