START=05
start() {
- cat <<' EOF' | lua -l luci.fs -l luci.sys -
+ cat <<' EOF' | lua -l luci.fs -l luci.util -
if (os.time() < 1000000000) then
- os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
+ os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.util.libpath())))
end
EOF
}
require("luci.fs")
require("luci.i18n")
require("luci.config")
- require("luci.sys")
+ require("luci.util")
- local cbidir = luci.sys.libpath() .. "/model/cbi/"
+ local cbidir = luci.util.libpath() .. "/model/cbi/"
local func, err = loadfile(cbidir..cbimap..".lua")
if not func then
]]--
---- LuCI system utilities.
+--- LuCI Linux and POSIX system utilities.
module("luci.sys", package.seeall)
require("posix")
require("luci.bits")
return source("wget -qO- '"..url:gsub("'", "").."'")
end
---- Returns the absolute path to LuCI base directory.
--- @return String containing the directory path
-function libpath()
- return luci.fs.dirname(require("luci.debug").__file__)
-end
-
--- Returns the system load average values.
-- @return String containing the average load value 1 minute ago
-- @return String containing the average load value 5 minutes ago
return data
end
+--- Returns the absolute path to LuCI base directory.
+-- @return String containing the directory path
+function libpath()
+ return luci.fs.dirname(require("luci.debug").__file__)
+end
+
+
--
-- Coroutine safe xpcall and pcall versions modified for Luci
-- original version:
--- Generate the dispatching index using the best possible strategy.
function createindex()
- local path = luci.sys.libpath() .. "/controller/"
+ local path = luci.util.libpath() .. "/controller/"
local suff = ".lua"
if luci.util.copcall(require, "luci.fastindex") then
--- LuCI translation library.
module("luci.i18n", package.seeall)
-require("luci.sys")
+require("luci.util")
table = {}
-i18ndir = luci.sys.libpath() .. "/i18n/"
+i18ndir = luci.util.libpath() .. "/i18n/"
loaded = {}
context = luci.util.threadlocal()
default = "en"
require("luci.config")
require("luci.util")
require("luci.fs")
+require("luci.sys")
require("luci.http")
luci.config.template = luci.config.template or {}
-viewdir = luci.config.template.viewdir or luci.sys.libpath() .. "/view"
-compiledir = luci.config.template.compiledir or luci.sys.libpath() .. "/view"
+viewdir = luci.config.template.viewdir or luci.util.libpath() .. "/view"
+compiledir = luci.config.template.compiledir or luci.util.libpath() .. "/view"
-- Compile modes: