summaryrefslogtreecommitdiffstats
path: root/lbu-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lbu-model.lua')
-rw-r--r--lbu-model.lua28
1 files changed, 2 insertions, 26 deletions
diff --git a/lbu-model.lua b/lbu-model.lua
index 1022e32..14d025b 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -178,6 +178,7 @@ local function validatefilecontent (filedetails)
return success, filedetails
end
--[[
+-- FIXME - now the USB is mounted readonly by default, so have to check that too
local was_mounted
local mnt
local function mount()
@@ -398,32 +399,7 @@ function commit(self, input)
return input
end
--[[
-function getbackupfiles()
- mount()
- local files = {}
- local selected
- local f = io.popen("ls "..mnt.."/*.[0-9]*[0-9].tar.gz")
- for line in f:lines() do
- files[#files + 1] = line
- end
- f:close()
- if #files then
- f = io.popen("date -u -r "..mnt.."/*.apkovl.tar.gz +%Y%m%d%H%m%S")
- selected = string.match(files[1], "^[^.]*.") .. f:read("*l") .. ".tar.gz"
- end
- unmount()
- return cfe({ type="list", value=files, label="Backup archive list", selected = selected })
-end
-
-function selectbackupfile(file)
- mount()
- if string.find(file, "^"..mnt) and fs.is_file(file) then
- local f = io.popen("cp -p "..file.." "..string.match(file, "^[^.]*.").."apkovl.tar.gz")
- f:close()
- end
- unmount()
-end
-
+-- FIXME - create get_deletebackupfile function and modify for use with handle_form
function deletebackupfile(file)
mount()
if string.find(file, "^"..mnt) and fs.is_file(file) then