From ab447b48b4246d6bd9b117e5b1d6740e3b9be55d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 24 Jan 2012 20:42:01 +0000 Subject: Read the rulesfile location from the conf.d file --- iptables-model.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'iptables-model.lua') 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 -- cgit v1.2.3