mirror of https://github.com/aredn/aredn.git
Fix check-services which failed when services reduced to 0 (#1212)
This commit is contained in:
parent
d92876dccf
commit
2509ebdf3b
|
@ -112,11 +112,19 @@ if nhosts or not_empty(chosts) then
|
|||
do
|
||||
hosts[i] = host.ip .. " " .. host.host
|
||||
end
|
||||
cursor:set("olsrd", "nameservice", "hosts", hosts)
|
||||
if #hosts > 0 then
|
||||
cursor:set("olsrd", "nameservice", "hosts", hosts)
|
||||
else
|
||||
cursor:delete("olsrd", "nameservice", "hosts")
|
||||
end
|
||||
change = true
|
||||
end
|
||||
if nservices or not_empty(cservices) then
|
||||
cursor:set("olsrd", "nameservice", "service", services)
|
||||
if #services > 0 then
|
||||
cursor:set("olsrd", "nameservice", "service", services)
|
||||
else
|
||||
cursor:delete("olsrd", "nameservice", "service")
|
||||
end
|
||||
change = true
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue