1
0
mirror of https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git synced 2023-10-10 11:37:40 +00:00

Catch wlan_scan errors

This commit is contained in:
Jan Schneider 2020-12-12 17:03:27 +01:00
parent d3b820601a
commit 5a36e36793

View File

@ -1818,6 +1818,7 @@ proc ::rmupdate::wlan_set_blocked {block {device "wlan0"}} {
proc ::rmupdate::wlan_scan {{as_json 0} {device "wlan0"}} {
array set ssids {}
if [catch {
set blocked [wlan_get_blocked $device]
if {$blocked == 1} {
wlan_set_blocked 0 $device
@ -1855,6 +1856,9 @@ proc ::rmupdate::wlan_scan {{as_json 0} {device "wlan0"}} {
set ssids(${cur_ssid}::ssid) $cur_ssid
set ssids(${cur_ssid}::signal) $cur_signal
}
} err] {
write_log 1 "WLAN scan failed: ${err}"
}
if {$as_json == 1} {
return [array_to_json [array get ssids]]