luci-portconfig: fix dns

This commit is contained in:
Nils Schneider 2014-08-10 17:13:39 +02:00
parent 9e1d5bb4f3
commit 28e332ae11
1 changed files with 3 additions and 3 deletions

View File

@ -116,10 +116,10 @@ function f.handle(self, state, data)
uci:commit("network")
if dns then
if data.dns then
uci:set("gluon-wan-dnsmasq", dns, "server", data.dns)
if #data.dns > 0 then
uci:set("gluon-wan-dnsmasq", dns, "server", data.dns)
else
uci:delete("gluon-wan-dnsmasq", dns, "server")
uci:delete("gluon-wan-dnsmasq", dns, "server")
end
uci:save("gluon-wan-dnsmasq")