summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
diff options
context:
space:
mode:
authorGiovanni Giacobbi <giovanni@giacobbi.net>2021-01-16 15:30:03 +0100
committerHannu Nyman <hannu.nyman@iki.fi>2021-01-20 17:48:16 +0200
commitaf422b192462813150863752f9c300af55df4996 (patch)
treeef07c2f73da55ba53792d792e287674f01ddd535 /modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
parentd3280e6f5df17b799230e229c9472cf8854015ae (diff)
treewide: removed trailing whitespaces and extra newlines in 'modules'
Signed-off-by: Giovanni Giacobbi <giovanni@giacobbi.net>
Diffstat (limited to 'modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua')
-rw-r--r--modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua b/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
index 74a5ae4d36..b23193a170 100644
--- a/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
+++ b/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
@@ -17,8 +17,8 @@ function action_backup()
local reset_avail = os.execute([[grep '"rootfs_data"' /proc/mtd >/dev/null 2>&1]]) == 0
local restore_cmd = "gunzip | tar -xC/ >/dev/null 2>&1"
local backup_cmd = "tar -c %s | gzip 2>/dev/null"
-
- local restore_fpi
+
+ local restore_fpi
luci.http.setfilehandler(
function(meta, chunk, eof)
if not restore_fpi then
@@ -32,11 +32,11 @@ function action_backup()
end
end
)
-
+
local upload = luci.http.formvalue("archive")
local backup = luci.http.formvalue("backup")
local reset = reset_avail and luci.http.formvalue("reset")
-
+
if upload and #upload > 0 then
luci.template.render("mini/applyreboot")
luci.sys.reboot()
@@ -66,7 +66,7 @@ function action_upgrade()
require("luci.model.uci")
local tmpfile = "/tmp/firmware.img"
-
+
local function image_supported()
-- XXX: yay...
return ( 0 == os.execute(
@@ -76,11 +76,11 @@ function action_upgrade()
% tmpfile
) )
end
-
+
local function image_checksum()
return (luci.sys.exec("md5sum %q" % tmpfile):match("^([^%s]+)"))
end
-
+
local function storage_size()
local size = 0
if nixio.fs.access("/proc/mtd") then
@@ -128,9 +128,9 @@ function action_upgrade()
local has_support = image_supported()
local has_platform = nixio.fs.access("/lib/upgrade/platform.sh")
local has_upload = luci.http.formvalue("image")
-
+
-- This does the actual flashing which is invoked inside an iframe
- -- so don't produce meaningful errors here because the the
+ -- so don't produce meaningful errors here because the the
-- previous pages should arrange the stuff as required.
if step == 4 then
if has_platform and has_image and has_support then
@@ -163,7 +163,7 @@ function action_upgrade()
if has_image then
nixio.fs.unlink(tmpfile)
end
-
+
luci.template.render("mini/upgrade", {
step=1,
bad_image=(has_image and not has_support or false),
@@ -180,14 +180,14 @@ function action_upgrade()
flashsize=storage_size(),
keepconfig=(keep_avail and luci.http.formvalue("keepcfg") == "1")
} )
-
+
-- Step 3: load iframe which calls the actual flash procedure
elseif step == 3 then
luci.template.render("mini/upgrade", {
step=3,
keepconfig=(keep_avail and luci.http.formvalue("keepcfg") == "1")
} )
- end
+ end
end
function _keep_pattern()