X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fcontroller%2Fadmin%2Fsystem.lua;h=c90ecc3ce92dc2e7e02f79c95f6e6ae7c2f1c03e;hp=1aabe637a19aad3c1ce286568d1808c011d7cfe3;hb=8fcd841aa9af96c8a4a4d3c1a555d2d1ed42332c;hpb=6abba6163290b58cd9ebae98d8459ac38ef52a4b diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua index 1aabe637a..c90ecc3ce 100644 --- a/modules/admin-full/luasrc/controller/admin/system.lua +++ b/modules/admin-full/luasrc/controller/admin/system.lua @@ -27,7 +27,7 @@ function index() entry({"admin", "system", "processes"}, form("admin_system/processes"), i18n("process_head"), 45) entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), i18n("a_s_fstab"), 50) - if luci.fs.isdirectory("/sys/class/leds") then + if nixio.fs.access("/sys/class/leds") then entry({"admin", "system", "leds"}, cbi("admin_system/leds"), i18n("leds", "LEDs"), 60) end @@ -124,7 +124,7 @@ function action_packages() -- Remove index cache if changes then - luci.fs.unlink("/tmp/luci-indexcache") + nixio.fs.unlink("/tmp/luci-indexcache") end end @@ -214,7 +214,7 @@ function action_upgrade() local function storage_size() local size = 0 - if luci.fs.access("/proc/mtd") then + if nixio.fs.access("/proc/mtd") then for l in io.lines("/proc/mtd") do local d, s, e, n = l:match('^([^%s]+)%s+([^%s]+)%s+([^%s]+)%s+"([^%s]+)"') if n == "linux" then @@ -222,7 +222,7 @@ function action_upgrade() break end end - elseif luci.fs.access("/proc/partitions") then + elseif nixio.fs.access("/proc/partitions") then for l in io.lines("/proc/partitions") do local x, y, b, n = l:match('^%s*(%d+)%s+(%d+)%s+([^%s]+)%s+([^%s]+)') if b and n and not n:match('[0-9]') then @@ -239,7 +239,7 @@ function action_upgrade() local file luci.http.setfilehandler( function(meta, chunk, eof) - if not luci.fs.access(tmpfile) and not file and chunk and #chunk > 0 then + if not nixio.fs.access(tmpfile) and not file and chunk and #chunk > 0 then file = io.open(tmpfile, "w") end if file and chunk then @@ -255,9 +255,9 @@ function action_upgrade() -- Determine state local keep_avail = true local step = tonumber(luci.http.formvalue("step") or 1) - local has_image = luci.fs.access(tmpfile) + local has_image = nixio.fs.access(tmpfile) local has_support = image_supported() - local has_platform = luci.fs.access("/lib/upgrade/platform.sh") + 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 @@ -298,7 +298,7 @@ function action_upgrade() -- If there is an image but user has requested step 1 -- or type is not supported, then remove it. if has_image then - luci.fs.unlink(tmpfile) + nixio.fs.unlink(tmpfile) end luci.template.render("admin_system/upgrade", { @@ -313,7 +313,7 @@ function action_upgrade() luci.template.render("admin_system/upgrade", { step=2, checksum=image_checksum(), - filesize=luci.fs.stat(tmpfile).size, + filesize=nixio.fs.stat(tmpfile).size, flashsize=storage_size(), keepconfig=(keep_avail and luci.http.formvalue("keepcfg") == "1") } ) @@ -333,7 +333,7 @@ function _keep_pattern() if files then kpattern = "" for k, v in pairs(files) do - if k:sub(1,1) ~= "." and luci.fs.glob(v) then + if k:sub(1,1) ~= "." and nixio.fs.glob(v)() then kpattern = kpattern .. " " .. v end end