diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-01-24 20:42:01 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-01-24 20:42:01 +0000 |
commit | ab447b48b4246d6bd9b117e5b1d6740e3b9be55d (patch) | |
tree | ab0f6bfb9391bae034c5f1db4d6d8fad7f943909 | |
parent | 31a32612afa6c44292f36ea71a4d31619278d0fa (diff) | |
download | acf-iptables-ab447b48b4246d6bd9b117e5b1d6740e3b9be55d.tar.bz2 acf-iptables-ab447b48b4246d6bd9b117e5b1d6740e3b9be55d.tar.xz |
Read the rulesfile location from the conf.d file
-rw-r--r-- | iptables-model.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/iptables-model.lua b/iptables-model.lua index e13048f..9b23a79 100644 --- a/iptables-model.lua +++ b/iptables-model.lua @@ -9,7 +9,7 @@ require("validator") -- Set variables local packagename = "iptables" local servicename = "iptables" -local rulesfile = "/var/lib/iptables/rules-save" +local configfile = "/etc/conf.d/iptables" local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " local tables = {"filter", "nat", "mangle"} @@ -548,10 +548,12 @@ function delete_rule(tab, chain, pos) end function readrulesfile() + local rulesfile = format.get_ini_entry(fs.read_file(configfile) or "", "", "IPTABLES_SAVE") return modelfunctions.getfiledetails(rulesfile) end function updaterulesfile(filedetails) + local rulesfile = format.get_ini_entry(fs.read_file(configfile) or "", "", "IPTABLES_SAVE") return modelfunctions.setfiledetails(filedetails, {rulesfile}) end |