diff options
author | Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk> | 2017-02-11 20:31:58 +0000 |
---|---|---|
committer | Hannu Nyman <hannu.nyman@iki.fi> | 2017-07-05 23:16:19 +0300 |
commit | 27dfff83cb323c12f57394cc923051c2e7a5c51c (patch) | |
tree | 67e16b2243c1de21b5d1f57744e06fdbfd04b0e4 /applications/luci-app-upnp | |
parent | 6fbf4c7dae6180ffc3a64046f1f4aa68db650d8b (diff) |
luci-minuupnpd: use enable flag
Add a 'master' miniupnpd service enable flag rather than just relying on
rcS.d script existence. This allows the service to be disabled
across sysupgrade, similar to minidlna.
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
(cherry picked from commit 1093327a4ddaf377fde40fdfb8ed168abac4b5eb)
Diffstat (limited to 'applications/luci-app-upnp')
-rw-r--r-- | applications/luci-app-upnp/luasrc/model/cbi/upnp/upnp.lua | 12 |
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 f1bb450dd5..74b9d1d033 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" |