summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-12 16:12:23 +0000
committerSteven Barth <steven@midlink.org>2008-09-12 16:12:23 +0000
commit2bbc4eb3c33c3590433174c599ec9418bdb8f38a (patch)
treeec483f9e199ae9193aabc7c3cfeec390accbc7d7 /libs
parent65b0a2bfad5f24b851a14ab0a405e60f24321bdf (diff)
Revert "Redesigned firmware upgrade process"
Diffstat (limited to 'libs')
-rw-r--r--libs/sgi-cgi/luasrc/sgi/cgi.lua1
-rw-r--r--libs/sys/luasrc/sys.lua18
2 files changed, 3 insertions, 16 deletions
diff --git a/libs/sgi-cgi/luasrc/sgi/cgi.lua b/libs/sgi-cgi/luasrc/sgi/cgi.lua
index f78adeaed..d36d43fb5 100644
--- a/libs/sgi-cgi/luasrc/sgi/cgi.lua
+++ b/libs/sgi-cgi/luasrc/sgi/cgi.lua
@@ -61,7 +61,6 @@ function run()
elseif id == 4 then
io.write(data1)
elseif id == 5 then
- io.close()
active = false
end
end
diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua
index cf7fbc05f..e27e1c4e8 100644
--- a/libs/sys/luasrc/sys.lua
+++ b/libs/sys/luasrc/sys.lua
@@ -60,27 +60,15 @@ exec = luci.util.exec
--- Invoke the luci-flash executable to write an image to the flash memory.
-- @param image Local path or URL to image file
-- @param kpattern Pattern of files to keep over flash process
--- @return boolean indicating status
--- @return error message if any
+-- @return Return value of os.execute()
function flash(image, kpattern)
local cmd = "luci-flash "
if kpattern then
cmd = cmd .. "-k '" .. kpattern:gsub("'", "") .. "' "
end
- cmd = cmd .. "'" .. image:gsub("'", "") .. "' 2>/dev/null &"
+ cmd = cmd .. "'" .. image:gsub("'", "") .. "' >/dev/null 2>&1"
- local fp = io.popen(cmd)
- fp:setvbuf("no")
-
- local line = fp:read()
-
- if line == "Invalid image type" then
- fp:close()
- return false, line
- else
- fp:close()
- return true
- end
+ return os.execute(cmd)
end
--- Retrieve information about currently mounted file systems.