diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-24 20:41:58 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-24 20:41:58 +0000 |
commit | 9cd4c138af69421eab0899df495a834d7a6816fb (patch) | |
tree | dabe9593589b3d12dde7b5ddd52871f628c32b19 /lbu-model.lua | |
parent | 3f751401830534a26f9547160d665d07adeed87e (diff) | |
download | acf-alpine-conf-9cd4c138af69421eab0899df495a834d7a6816fb.tar.bz2 acf-alpine-conf-9cd4c138af69421eab0899df495a834d7a6816fb.tar.xz |
Save work for today Working on:
What happens if config-file doesnt exist.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-conf/trunk@645 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lbu-model.lua')
-rw-r--r-- | lbu-model.lua | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lbu-model.lua b/lbu-model.lua index e8ac94a..14fb9d3 100644 --- a/lbu-model.lua +++ b/lbu-model.lua @@ -99,7 +99,7 @@ function getstatus () else statustxt = "WARNING! (Until you commit, you will lose your changes at next reboot/shutdown!)" end - local config = getopts.getoptsfromfile(path) + local config = getconfig() status["LBU_MEDIA"] = config["LBU_MEDIA"] status["ENCRYPTION"] = config["ENCRYPTION"] status["DEFAULT_CIPHER"] = config["DEFAULT_CIPHER"] @@ -144,10 +144,17 @@ function getconfig () local lbumedias = {} table.insert(lbumedias, {name="floppy", value="floppy"}) table.insert(lbumedias, {name="usb", value="usb"}) - config = getopts.getoptsfromfile(path) - config["lbu_included"]= getincexl("include") - config["lbu_excluded"]= getincexl("exclude") - config["LBU_MEDIA_LIST"]= lbumedias + if (fs.is_file(path)) then + config = getopts.getoptsfromfile(path) + config["lbu_included"]= getincexl("include") + config["lbu_excluded"]= getincexl("exclude") + config["LBU_MEDIA_LIST"]= lbumedias + else + --FIXME: What if the configfile doesn't exist (below is a beginning of fixing it... please continue) + config["lbu_included"]= "" + config["lbu_excluded"]= "" + config["LBU_MEDIA_LIST"]= "" + end config["DEFAULT_CIPHER_LIST"]= getciphers() -- config["debug"] = getciphers() return config |