mirror of https://github.com/aredn/aredn.git
Improve rss_monitor startup (#346) 04/27/2022
And shut down if we hae no wifi to monitor
This commit is contained in:
parent
3f2adcc002
commit
7aff95711e
|
@ -35,13 +35,16 @@
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
function rssi_monitor()
|
function rssi_monitor()
|
||||||
|
if string.match(get_ifname("wifi"), "^eth.") then
|
||||||
|
exit_app()
|
||||||
|
else
|
||||||
|
wait_for_ticks(math.max(1, 120 - nixio.sysinfo().uptime))
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
if not string.match(get_ifname("wifi"), "^eth.") and nixio.sysinfo().uptime > 119 then
|
|
||||||
run_monitor()
|
run_monitor()
|
||||||
end
|
|
||||||
wait_for_ticks(60) -- 1 minute
|
wait_for_ticks(60) -- 1 minute
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local datfile = "/tmp/rssi.dat"
|
local datfile = "/tmp/rssi.dat"
|
||||||
|
|
Loading…
Reference in New Issue