From 3652628e960166e306d6243e7b3c0af644af76c9 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 10 Aug 2014 17:13:39 +0200 Subject: [PATCH] luci-portconfig: fix dns --- .../files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua index fefe14c2..7233d5c9 100644 --- a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua +++ b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua @@ -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")