applications/luci-upnp: also stop miniupnpd if it is about to be disabled
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 28 Jan 2009 18:32:26 +0000 (18:32 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 28 Jan 2009 18:32:26 +0000 (18:32 +0000)
applications/luci-upnp/luasrc/model/cbi/upnp/upnp.lua
applications/luci-upnp/luasrc/model/cbi/upnp/upnpmini.lua

index a485081..97fe88e 100644 (file)
@@ -20,6 +20,9 @@ e.rmempty = false
 
 function e.write(self, section, value)
        local cmd = (value == "1") and "enable" or "disable"
 
 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
 
        os.execute("/etc/init.d/miniupnpd " .. cmd)
 end
 
index 8ad03a3..3e19b95 100644 (file)
@@ -20,6 +20,9 @@ e.rmempty = false
 
 function e.write(self, section, value)
        local cmd = (value == "1") and "enable" or "disable"
 
 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
 
        os.execute("/etc/init.d/miniupnpd " .. cmd)
 end