check if nic is down

This commit is contained in:
avollkopf 2022-03-08 19:43:37 +01:00
parent c3c4101b6b
commit 12803b62c4
2 changed files with 21 additions and 9 deletions

View file

@ -1 +1 @@
__version__ = "4.0.2.0.a17" __version__ = "4.0.2.0.a18"

View file

@ -231,11 +231,17 @@ class SystemController:
try: try:
for nic in info: for nic in info:
if nic == 'eth0': if nic == 'eth0':
if info[nic].speed: if info[nic].isup == True:
eth0speed = info[nic].speed if info[nic].speed:
eth0speed = info[nic].speed
else:
eth0speed = "down"
if nic == 'wlan0': if nic == 'wlan0':
if info[nic].speed: if info[nic].isup == True:
wlan0speed = info[nic].speed if info[nic].speed:
wlan0speed = info[nic].speed
else:
wlan0speed = "down"
except Exception as e: except Exception as e:
logging.info(e) logging.info(e)
except: except:
@ -259,11 +265,17 @@ class SystemController:
try: try:
for nic in info: for nic in info:
if nic == 'Ethernet': if nic == 'Ethernet':
if info[nic].speed: if info[nic].isup == True:
eth0speed = info[nic].speed if info[nic].speed:
eth0speed = info[nic].speed
else:
eth0speed = "down"
if nic == 'WLAN': if nic == 'WLAN':
if info[nic].speed: if info[nic].isup == True:
wlan0speed = info[nic].speed if info[nic].speed:
wlan0speed = info[nic].speed
else:
wlan0speed = "down"
except Exception as e: except Exception as e:
logging.info(e) logging.info(e)
except: except: