summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/sys.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/ffluci/sys.lua')
-rw-r--r--src/ffluci/sys.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ffluci/sys.lua b/src/ffluci/sys.lua
index 367d41e8c1..d8fbaa57a0 100644
--- a/src/ffluci/sys.lua
+++ b/src/ffluci/sys.lua
@@ -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")()