try and except just in case
This commit is contained in:
parent
b50fac4e76
commit
1a1515f2a1
@ -1734,6 +1734,7 @@ def savePromptStartStop():
|
||||
|
||||
@app.route("/scanNetworks", methods=["PUT", "POST"])
|
||||
def scanNetworks2():
|
||||
try:
|
||||
output = subprocess.check_output(['sudo', 'iwlist', 'wlan0', 'scan'])
|
||||
output_str = output.decode('utf-8')
|
||||
lines = output_str.split('Cell')
|
||||
@ -1756,7 +1757,9 @@ def scanNetworks2():
|
||||
pair_cipher = ''
|
||||
# quality = line.split('Quality=')[1].split('Signal level')[0].replace(" ", "")
|
||||
networks[ssid] = {'group_cipher': group_cipher, 'pair_cipher': pair_cipher}
|
||||
|
||||
except:
|
||||
global networks
|
||||
networks = {}
|
||||
return (networks)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user