mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-24 22:44:56 +01:00
check if nic is down
This commit is contained in:
parent
c3c4101b6b
commit
12803b62c4
2 changed files with 21 additions and 9 deletions
|
@ -1 +1 @@
|
|||
__version__ = "4.0.2.0.a17"
|
||||
__version__ = "4.0.2.0.a18"
|
||||
|
|
|
@ -231,11 +231,17 @@ class SystemController:
|
|||
try:
|
||||
for nic in info:
|
||||
if nic == 'eth0':
|
||||
if info[nic].speed:
|
||||
eth0speed = info[nic].speed
|
||||
if info[nic].isup == True:
|
||||
if info[nic].speed:
|
||||
eth0speed = info[nic].speed
|
||||
else:
|
||||
eth0speed = "down"
|
||||
if nic == 'wlan0':
|
||||
if info[nic].speed:
|
||||
wlan0speed = info[nic].speed
|
||||
if info[nic].isup == True:
|
||||
if info[nic].speed:
|
||||
wlan0speed = info[nic].speed
|
||||
else:
|
||||
wlan0speed = "down"
|
||||
except Exception as e:
|
||||
logging.info(e)
|
||||
except:
|
||||
|
@ -259,11 +265,17 @@ class SystemController:
|
|||
try:
|
||||
for nic in info:
|
||||
if nic == 'Ethernet':
|
||||
if info[nic].speed:
|
||||
eth0speed = info[nic].speed
|
||||
if info[nic].isup == True:
|
||||
if info[nic].speed:
|
||||
eth0speed = info[nic].speed
|
||||
else:
|
||||
eth0speed = "down"
|
||||
if nic == 'WLAN':
|
||||
if info[nic].speed:
|
||||
wlan0speed = info[nic].speed
|
||||
if info[nic].isup == True:
|
||||
if info[nic].speed:
|
||||
wlan0speed = info[nic].speed
|
||||
else:
|
||||
wlan0speed = "down"
|
||||
except Exception as e:
|
||||
logging.info(e)
|
||||
except:
|
||||
|
|
Loading…
Reference in a new issue