Added a mac->iface lookup function, just to make the templte codes easier to read.
This commit is contained in:
parent
07e6e91f3c
commit
5470434097
|
|
@ -18,3 +18,6 @@ def list_interfaces(skip_loopback=True):
|
|||
mac = getHwAddr(iface).replace(':', '-').lower()
|
||||
interfaces[mac] = iface
|
||||
return interfaces
|
||||
|
||||
def get_interface_from_mac(mac):
|
||||
return list_interfaces().get(mac, None)
|
||||
Loading…
Reference in New Issue