Help with new intrusion prevention rule selector tab - not saving
I am tiring to add another tab to the intrusion prevention window which allow the user to select which snort rule to use, these are then written to a config file which I then use bash to sort out which rules need to be downloaded.
I have already added the tab and selection field with firefox and tick box, I can’t seem to find how to write this to it’s own config file /etc/config/snort1. I think it's got something to do with this
s = m:section(NamedSection, "snort1")
The code below I have stripped all tabs out except the snort rule selector one just for ease of viewing
Any help would be appreciate
LuCI Snort module
Copyright (C) 2015, Itus Networks, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
local fs = require "nixio.fs"
local sys = require "luci.sys"
m = Map("snort", translate("Intrusion Prevention"), translate("Changes may take up to 90 seconds to take effect, service may be interrupted during that time. The IPS engine will restart each time you click the Save & Apply or On/Off button."))
m.on_init = function()
luci.sys.call("sed '1!G;h$!d' /tmp/snort/alert > /tmp/snort/alert2")
m.reset = false
m.submit = false
s = m:section(NamedSection, "snort")
s.anonymous = true
s.addremove = false