No internet feature

This commit is contained in:
Félix Aime
2021-02-15 20:46:56 +01:00
parent f4d361488c
commit 488c0cdb1b
13 changed files with 185 additions and 178 deletions

View File

@ -62,7 +62,7 @@ class Config(object):
config[cat][key] = value
if key == "out":
config[cat][key] = value
elif re.match("^(nonet|eth[0-9]|en[a-z0-9]{20})$", value) and key == "out":
elif re.match("^(eth[0-9]|en[a-z0-9]{20})$", value) and key == "out":
config[cat][key] = value
else:
return {"status": False,
@ -137,7 +137,7 @@ class Config(object):
:return: list of the interfaces
"""
try:
return [i for i in os.listdir("/sys/class/net/") if i.startswith(("wl", "et"))]+["nonet"]
return [i for i in os.listdir("/sys/class/net/") if i.startswith(("wl", "et"))]
except:
return ["No network interfaces"]