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:
parent
d3b820601a
commit
5a36e36793
@ -1818,6 +1818,7 @@ proc ::rmupdate::wlan_set_blocked {block {device "wlan0"}} {
|
|||||||
|
|
||||||
proc ::rmupdate::wlan_scan {{as_json 0} {device "wlan0"}} {
|
proc ::rmupdate::wlan_scan {{as_json 0} {device "wlan0"}} {
|
||||||
array set ssids {}
|
array set ssids {}
|
||||||
|
if [catch {
|
||||||
set blocked [wlan_get_blocked $device]
|
set blocked [wlan_get_blocked $device]
|
||||||
if {$blocked == 1} {
|
if {$blocked == 1} {
|
||||||
wlan_set_blocked 0 $device
|
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}::ssid) $cur_ssid
|
||||||
set ssids(${cur_ssid}::signal) $cur_signal
|
set ssids(${cur_ssid}::signal) $cur_signal
|
||||||
}
|
}
|
||||||
|
} err] {
|
||||||
|
write_log 1 "WLAN scan failed: ${err}"
|
||||||
|
}
|
||||||
|
|
||||||
if {$as_json == 1} {
|
if {$as_json == 1} {
|
||||||
return [array_to_json [array get ssids]]
|
return [array_to_json [array get ssids]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user