applications/luci-upnp: also stop miniupnpd if it is about to be disabled
[project/luci.git] / applications / luci-upnp / luasrc / model / cbi / upnp / upnpmini.lua
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"
+       if value ~= "1" then
+               os.execute("/etc/init.d/miniupnpd stop")
+       end
        os.execute("/etc/init.d/miniupnpd " .. cmd)
 end