mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 11:37:24 +00:00
Fix: function usedMemory
While language in console is not English, this function may return `nan`
This commit is contained in:
parent
4299d4d7cc
commit
c0b0d87ff4
@ -42,7 +42,7 @@ class Sysinfo
|
|||||||
|
|
||||||
public function usedMemory()
|
public function usedMemory()
|
||||||
{
|
{
|
||||||
$used = shell_exec("free -m | awk '/Mem:/ { total=$2 ; used=$3 } END { print used/total*100}'");
|
$used = shell_exec("free -m | awk 'NR==2{ total=$2 ; used=$3 } END { print used/total*100}'");
|
||||||
return floor($used);
|
return floor($used);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user