summaryrefslogtreecommitdiffstats
path: root/lbu-model.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-01-25 15:42:57 +0000
committerMika Havela <mika.havela@gmail.com>2008-01-25 15:42:57 +0000
commit64ed4dd6998ab8cbfe5b4042e9c91fe86a49c551 (patch)
tree239bb21388fe731f1991d483812053fe94fc58ac /lbu-model.lua
parent1bf6e76a2d62e1f2746a6a4187dbd0d7a82e79f8 (diff)
downloadacf-alpine-conf-64ed4dd6998ab8cbfe5b4042e9c91fe86a49c551.tar.bz2
acf-alpine-conf-64ed4dd6998ab8cbfe5b4042e9c91fe86a49c551.tar.xz
Added a expert-tab like in other acf-modules
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-conf/trunk@654 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lbu-model.lua')
-rw-r--r--lbu-model.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/lbu-model.lua b/lbu-model.lua
index 9ff31a4..f38d34d 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -3,6 +3,7 @@ module (..., package.seeall)
require("fs")
require("format")
require("getopts")
+require("daemoncontrol")
local configfile = "/etc/lbu/lbu.conf"
@@ -200,4 +201,20 @@ function editconfig (self,variable,value)
fs.write_file(path,table.concat(cmdoutput,"\n"))
return cmdoutput
end
+function get_filedetails()
+ local filedetails = {}
+ local path = configfile
+ filedetails.details = {path=path, size="0",mtime=""}
+ filedetails.content = ""
+ if (fs.is_file(path)) then
+ filedetails.details = fs.stat(path)
+ filedetails.content = fs.read_file(path)
+ end
+ return filedetails
+end
+function update_filecontent (self, modifications)
+ local path = configfile
+ local file_result,err = fs.write_file(path, format.dostounix(modifications))
+ return file_result, err
+end