diff options
Diffstat (limited to 'ipsectools-model.lua')
-rw-r--r-- | ipsectools-model.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ipsectools-model.lua b/ipsectools-model.lua index 3582900..6eed873 100644 --- a/ipsectools-model.lua +++ b/ipsectools-model.lua @@ -8,6 +8,7 @@ require("daemoncontrol") require("validator") local configfile = "/etc/racoon/racoon.conf" +local configfile2 = "/etc/ipsec.conf" local processname = "racoon" local pkgname = "ipsec-tools" local baseurl = "/etc/racoon/" @@ -215,10 +216,42 @@ function get_filedetails() label="File content", value=fs.read_file(path), }) + + path = configfile2 + filedetails = fs.stat(path) + file["filename2"] = cfe({ + name="filename2", + label="File name", + value=path, + }) + file["filesize2"] = cfe({ + name="filesize2", + label="File size", + value=filedetails.size or 0, + }) + file["mtime2"] = cfe({ + name="mtime2", + label="File date", + value=filedetails.mtime or "---", + }) + file["filecontent2"] = cfe({ + type="longtext", + name="filecontent2", + label="File content", + value=fs.read_file(path), + }) + + return file end + function update_filecontent (self, modifications) local path = configfile local file_result,err = fs.write_file(path, format.dostounix(modifications)) return file_result end +function update_filecontent2 (self, modifications) + local path = configfile2 + local file_result,err = fs.write_file(path, format.dostounix(modifications)) + return file_result +end |