summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFlorian Eckert <Eckert.Florian@googlemail.com>2016-12-20 11:12:42 +0100
committerFlorian Eckert <Eckert.Florian@googlemail.com>2016-12-20 11:12:42 +0100
commit0581bd5f0be96e0428c7e9fa2a4f6663e4dbfca1 (patch)
treed0df37b4002aefa6e5d2c99b64aa0c868d828037
parent1741e5578c5d2d72d3037f17fb0cc0f93ddf4e2e (diff)
luci-app-firewall: restart firewall on /etc/firewall.user write
Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua
index 968ac3624..2b3cee328 100644
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua
+++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua
@@ -22,6 +22,10 @@ end
function o.write(self, section, value)
value = value:gsub("\r\n?", "\n")
fs.writefile("/etc/firewall.user", value)
+ require("luci.sys").call("/etc/init.d/firewall restart >/dev/null 2<&1")
+ require("nixio").syslog('info', 'Restarting firewall on custom /etc/firewall.user change')
end
+f.submit = translate("Restart Firewall")
+
return f