* Completed Firmware-Upgrade page
[project/luci.git] / src / ffluci / sys.lua
index 367d41e8c1c25dcc27237b6feed51d8398b6ff8a..d8fbaa57a05496d3b170e3fd51ee083265dfef87 100644 (file)
@@ -52,6 +52,17 @@ function execl(command)
        return data
 end
 
+-- Uses "ffluci-flash" to flash a new image file to the system
+function flash(image, kpattern)
+       local cmd = "ffluci-flash "
+       if kpattern then
+               cmd = cmd .. "-k '" .. kapttern:gsub("'", "") .. "' "
+       end
+       cmd = cmd .. "'" .. image:gsub("'", "") .. "'"
+       
+       return os.execute(cmd)
+end
+
 -- Returns the hostname
 function hostname()
        return io.lines("/proc/sys/kernel/hostname")()