luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / protocols / luci-proto-ppp / luasrc / model / cbi / admin_network / proto_pptp.lua
index 11104099cc06d55c5fc6fed14bb3321e942ec6d8..6a828efe9655bac007b788449f4b3dabc0d62b31 100644 (file)
@@ -1,14 +1,5 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-]]--
+-- Copyright 2011-2012 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
 
 local map, section, net = ...
 
@@ -18,7 +9,7 @@ local defaultroute, metric, peerdns, dns,
 
 
 server = section:taboption("general", Value, "server", translate("VPN Server"))
-server.datatype = "host"
+server.datatype = "host(0)"
 
 
 username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
@@ -91,7 +82,7 @@ function keepalive_interval.write(self, section, value)
        if f > 0 then
                m:set(section, "keepalive", "%d %d" %{ f, i })
        else
-               m:del(section, "keepalive")
+               m:set(section, "keepalive", "0")
        end
 end