summaryrefslogtreecommitdiffstats
path: root/ipsectools-model.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-04-02 11:43:27 +0000
committerMika Havela <mika.havela@gmail.com>2008-04-02 11:43:27 +0000
commit15f432dd230df053f861e97638aed42befab24f9 (patch)
treee73223e039cd3f8448fb448ea5fae680f006cc08 /ipsectools-model.lua
parentbfbd3a922f57bded604819b2bd6d0703fabf985b (diff)
downloadacf-ipsec-tools-15f432dd230df053f861e97638aed42befab24f9.tar.bz2
acf-ipsec-tools-15f432dd230df053f861e97638aed42befab24f9.tar.xz
Added /etc/ipsec.conf to the expert-tab.v0.2.0
git-svn-id: svn://svn.alpinelinux.org/acf/ipsec-tools/trunk@893 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'ipsectools-model.lua')
-rw-r--r--ipsectools-model.lua33
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