diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-17 09:38:24 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-17 09:38:24 +0000 |
commit | a83f38291b0de75d5f92f5cda7a9cabd8518faee (patch) | |
tree | 8ce090d035491056282a9cfbbcbe9901eee24754 /lbu-model.lua | |
parent | f07ff07b2b56a0fe23a186632d9d3ff39bbd57e6 (diff) | |
download | acf-alpine-conf-a83f38291b0de75d5f92f5cda7a9cabd8518faee.tar.bz2 acf-alpine-conf-a83f38291b0de75d5f92f5cda7a9cabd8518faee.tar.xz |
Starts showing current config on the config-tab
git-svn-id: svn://svn.alpinelinux.org/acf/lbu/trunk@594 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lbu-model.lua')
-rw-r--r-- | lbu-model.lua | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lbu-model.lua b/lbu-model.lua index 8a362ce..3170736 100644 --- a/lbu-model.lua +++ b/lbu-model.lua @@ -1,6 +1,8 @@ module (..., package.seeall) -require "fs" +require("fs") +require("getopts") + local configfile = "/etc/lbu/lbu.conf" -- ################################################################################ @@ -29,6 +31,22 @@ local function getLbuStatus() return ret end +local function getciphers() + local opensslciphers = {} + local watchdog = nil + local f = io.popen("/usr/bin/openssl -v 2>&1", "r") + if not (f) then return ciphers end + for line in f:lines() do + if (watchdog) then + for cipher in string.gmatch(line, "(%S+)") do + table.insert(opensslciphers,tostring(cipher)) + end + end + if (string.match(line, "^Cipher commands")) then watchdog="yes" end + end + f:close() + return opensslciphers +end -- ################################################################################ -- PUBLIC FUNCTIONS @@ -57,6 +75,19 @@ function list(self) return ret end +function getconfig () + local path = configfile + local config = {} + local lbumedias = {} + table.insert(lbumedias, {name="No default", value=""}) + table.insert(lbumedias, {name="floppy", value="floppy"}) + table.insert(lbumedias, {name="usb", value="usb"}) + config = getopts.getoptsfromfile(path) + config["LBU_MEDIA_LIST"]= lbumedias + config["DEFAULT_CIPHER_LIST"]= getciphers() +-- config["debug"] = getciphers() + return config +end -- ################################################################################ -- OLD FUNCTIONS |