summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2010-12-15 16:35:19 +0000
committerManuel Munz <freifunk@somakoma.de>2010-12-15 16:35:19 +0000
commit6951da02ce0b5ffa5593d31173cee92d1b33ee3d (patch)
tree5569ece365beea8f3bd7843523f9c2c8ca028895 /libs
parentd0c8c5b5327484dbd88c924d5f44a33c11af8893 (diff)
modules/freifunk: Make status page update dynamically with javascript and small cosmetic changes.
Diffstat (limited to 'libs')
-rw-r--r--libs/sys/luasrc/sys.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua
index 61da6f1cb..817217b90 100644
--- a/libs/sys/luasrc/sys.lua
+++ b/libs/sys/luasrc/sys.lua
@@ -166,6 +166,7 @@ end
-- @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")
@@ -176,6 +177,7 @@ function sysinfo()
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("BogoMIPS.-:%s*([^\n]+)"))
if not system then
system = nixio.uname().machine
@@ -187,7 +189,7 @@ function sysinfo()
model = cpuinfo:match("cpu model.-:%s*([^\n]+)")
end
- return system, model, memtotal, memcached, membuffers, memfree
+ return system, model, memtotal, memcached, membuffers, memfree, bogomips
end
--- Retrieves the output of the "logread" command.