require("luci.util")
require("luci.fs")
---- Test wheather the current system is operating in big endian mode.
--- @return Boolean value indicating wheather system is big endian
+--- Test whether the current system is operating in big endian mode.
+-- @return Boolean value indicating whether system is big endian
function bigendian()
- local fp = io.open("/bin/sh")
- fp:seek("set", 5)
- local be = (fp:read(1):byte() ~= 1)
- fp:close()
- return be
+ return string.byte(string.dump(function() end), 7) == 0
end
--- Execute given commandline and gather stdout.
end
--- Invoke the luci-flash executable to write an image to the flash memory.
--- @param kpattern kpattern (ToDo: clearify this)
+-- @param kpattern Pattern of files to keep over flash process
-- @return Return value of os.execute()
function flash(image, kpattern)
local cmd = "luci-flash "
return loadavg:match("^(.-) (.-)$")
end
---- Get group information
--- @return Group (ToDo: clearify)
+--- LuCI system utilities / POSIX user group related functions.
+-- @class module
+-- @name luci.sys.group
group = {}
+
+--- Returns information about a POSIX user group.
+-- @param group Group ID or name of a system user group
+-- @return Table with information about the requested group
group.getgroup = posix.getgroup