luci-app-firewall: restart firewall on /etc/firewall.user write 889/head
authorFlorian Eckert <Eckert.Florian@googlemail.com>
Tue, 20 Dec 2016 10:12:42 +0000 (11:12 +0100)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Tue, 20 Dec 2016 10:12:42 +0000 (11:12 +0100)
Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
applications/luci-app-firewall/luasrc/model/cbi/firewall/custom.lua

index 968ac3624f31cc8bfbecda8ba5d6e6eb9dc67246..2b3cee328378d1995c96e5f87b34d9518a98f0c0 100644 (file)
@@ -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