summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-02-26 20:25:33 +0200
committerGitHub <noreply@github.com>2017-02-26 20:25:33 +0200
commit0f474fc3027154cdc94db4a5bafd54263875f001 (patch)
tree672e2f596f5fc8549b17bc3df746035b84ee1b3a
parent6e2647a9d6b9c0eef53dff1c2049981befd17d31 (diff)
parent1093327a4ddaf377fde40fdfb8ed168abac4b5eb (diff)
Merge pull request #1005 from kdarbyshirebryant/miniupnpenable
luci-minuupnpd: use enable flag
-rw-r--r--applications/luci-app-upnp/luasrc/model/cbi/upnp/upnp.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/applications/luci-app-upnp/luasrc/model/cbi/upnp/upnp.lua b/applications/luci-app-upnp/luasrc/model/cbi/upnp/upnp.lua
index f1bb450dd..74b9d1d03 100644
--- a/applications/luci-app-upnp/luasrc/model/cbi/upnp/upnp.lua
+++ b/applications/luci-app-upnp/luasrc/model/cbi/upnp/upnp.lua
@@ -12,21 +12,21 @@ s.addremove = false
s:tab("general", translate("General Settings"))
s:tab("advanced", translate("Advanced Settings"))
-e = s:taboption("general", Flag, "_init", translate("Start UPnP and NAT-PMP service"))
+e = s:taboption("general", Flag, "enabled", translate("Start UPnP and NAT-PMP service"))
e.rmempty = false
-function e.cfgvalue(self, section)
- return luci.sys.init.enabled("miniupnpd") and self.enabled or self.disabled
-end
+--function e.cfgvalue(self, section)
+-- return luci.sys.init.enabled("miniupnpd") and self.enabled or self.disabled
+--end
function e.write(self, section, value)
if value == "1" then
- luci.sys.call("/etc/init.d/miniupnpd enable >/dev/null")
luci.sys.call("/etc/init.d/miniupnpd start >/dev/null")
else
luci.sys.call("/etc/init.d/miniupnpd stop >/dev/null")
- luci.sys.call("/etc/init.d/miniupnpd disable >/dev/null")
end
+
+ return Flag.write(self, section, value)
end
s:taboption("general", Flag, "enable_upnp", translate("Enable UPnP functionality")).default = "1"