From 64ed4dd6998ab8cbfe5b4042e9c91fe86a49c551 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 25 Jan 2008 15:42:57 +0000 Subject: 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 --- lbu-model.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lbu-model.lua') 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 -- cgit v1.2.3