X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-upnp%2Fluasrc%2Fmodel%2Fcbi%2Fupnp%2Fupnp.lua;fp=applications%2Fluci-upnp%2Fluasrc%2Fmodel%2Fcbi%2Fupnp%2Fupnp.lua;h=79a38f7c53a09dd011fa16eb886ce76b21aacab6;hp=0000000000000000000000000000000000000000;hb=43b995148183a350c8d8af0dd202ad9dcc9fd8c9;hpb=53a0f9867af86c6732ff39b466fa2e653b29afe9 diff --git a/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua b/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua new file mode 100644 index 0000000000..79a38f7c53 --- /dev/null +++ b/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua @@ -0,0 +1,32 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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 + +$Id$ +]]-- +m = Map("upnpd", translate("upnpd"), translate("upnpd_desc")) + +s = m:section(NamedSection, "config", "upnpd", "") +e = s:option(Flag, "enabled", translate("enable")) +function e.write(self, section, value) + local cmd = (value == "1") and "enable" or "disable" + os.execute("/etc/init.d/miniupnpd " .. cmd) +end + +function e.cfgvalue(self, section) + return (os.execute("/etc/init.d/miniupnpd enabled") == 0) and "1" or "0" +end + +s:option(Flag, "log_output").rmempty = true +s:option(Value, "download").rmempty = true +s:option(Value, "upload").rmempty = true + +return m \ No newline at end of file