mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-01 03:04:14 +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:
|
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:
|
||||||
|
|
Loading…
Reference in a new issue