---- Returns the system type, cpu name and installed physical memory.
--- @return String containing the system or platform identifier
--- @return String containing hardware model information
--- @return String containing the total memory amount in kB
--- @return String containing the memory used for caching in kB
--- @return String containing the memory used for buffering in kB
--- @return String containing the free memory amount in kB
--- @return String containing the cpu bogomips (number)
-function sysinfo()
- local cpuinfo = fs.readfile("/proc/cpuinfo")
- local meminfo = fs.readfile("/proc/meminfo")
-
- local memtotal = tonumber(meminfo:match("MemTotal:%s*(%d+)"))
- local memcached = tonumber(meminfo:match("\nCached:%s*(%d+)"))
- local memfree = tonumber(meminfo:match("MemFree:%s*(%d+)"))
- local membuffers = tonumber(meminfo:match("Buffers:%s*(%d+)"))
- local bogomips = tonumber(cpuinfo:match("[Bb]ogo[Mm][Ii][Pp][Ss].-: ([^\n]+)")) or 0
- local swaptotal = tonumber(meminfo:match("SwapTotal:%s*(%d+)"))
- local swapcached = tonumber(meminfo:match("SwapCached:%s*(%d+)"))
- local swapfree = tonumber(meminfo:match("SwapFree:%s*(%d+)"))
-
- local system =
- cpuinfo:match("system type\t+: ([^\n]+)") or
- cpuinfo:match("Processor\t+: ([^\n]+)") or
- cpuinfo:match("model name\t+: ([^\n]+)")
-
- local model =
- fs.readfile("/proc/device-tree/model") or
- luci.util.pcdata(fs.readfile("/tmp/sysinfo/model")) or
- cpuinfo:match("machine\t+: ([^\n]+)") or
- cpuinfo:match("Hardware\t+: ([^\n]+)") or
- luci.util.pcdata(fs.readfile("/proc/diag/model")) or
- nixio.uname().machine or
- system
-
- return system, model, memtotal, memcached, membuffers, memfree, bogomips, swaptotal, swapcached, swapfree
-end
-