diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-01-28 18:32:26 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-01-28 18:32:26 +0000 |
commit | d5003fc23a5e4889dce39be8991080516e53483c (patch) | |
tree | 71b47e69f8544cd39fc001d542c8689bd4c39302 /applications/luci-upnp/luasrc/model/cbi/upnp | |
parent | 4fa887618ecb6fd0aa667f44ef0ef851a2ccfcde (diff) |
applications/luci-upnp: also stop miniupnpd if it is about to be disabled
Diffstat (limited to 'applications/luci-upnp/luasrc/model/cbi/upnp')
-rw-r--r-- | applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua | 3 | ||||
-rw-r--r-- | applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua b/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua index a485081297..97fe88e6c2 100644 --- a/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua +++ b/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua @@ -20,6 +20,9 @@ e.rmempty = false function e.write(self, section, value) local cmd = (value == "1") and "enable" or "disable" + if value ~= "1" then + os.execute("/etc/init.d/miniupnpd stop") + end os.execute("/etc/init.d/miniupnpd " .. cmd) end diff --git a/applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua b/applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua index 8ad03a36a0..3e19b95734 100644 --- a/applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua +++ b/applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua @@ -20,6 +20,9 @@ e.rmempty = false function e.write(self, section, value) local cmd = (value == "1") and "enable" or "disable" + if value ~= "1" then + os.execute("/etc/init.d/miniupnpd stop") + end os.execute("/etc/init.d/miniupnpd " .. cmd) end |