Update network.py
This commit is contained in:
parent
a93d6c7d5f
commit
c272bfebeb
@ -301,7 +301,9 @@ class Network(object):
|
|||||||
This enable interfaces, with a simple check.
|
This enable interfaces, with a simple check.
|
||||||
:return: bool if everything goes well
|
:return: bool if everything goes well
|
||||||
"""
|
"""
|
||||||
|
sh = sp.Popen(["ifconfig", iface],
|
||||||
|
stdout=sp.PIPE, stderr=sp.PIPE)
|
||||||
|
sh = sh.communicate()
|
||||||
if b"<UP," in sh[0]:
|
if b"<UP," in sh[0]:
|
||||||
return True # The interface is up.
|
return True # The interface is up.
|
||||||
elif sh[1]:
|
elif sh[1]:
|
||||||
|
Loading…
Reference in New Issue
Block a user