From 30ca47c27a5e0fd4dd4538523d5ee5f16282494e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 8 Apr 2008 19:15:11 +0000 Subject: * Completed Firmware-Upgrade page * Added Dnsmasq configuration page --- src/ffluci/sys.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ffluci/sys.lua') 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")() -- cgit v1.2.3