From d5003fc23a5e4889dce39be8991080516e53483c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 28 Jan 2009 18:32:26 +0000 Subject: applications/luci-upnp: also stop miniupnpd if it is about to be disabled --- applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua | 3 +++ applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua | 3 +++ 2 files changed, 6 insertions(+) (limited to 'applications') diff --git a/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua b/applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua index a48508129..97fe88e6c 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 8ad03a36a..3e19b9573 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 -- cgit v1.2.3