mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-27 07:31:09 +01:00
Add usedDisk() public method
This commit is contained in:
@@ -46,12 +46,18 @@ class Sysinfo
|
||||
return $systime;
|
||||
}
|
||||
|
||||
public function usedMemory()
|
||||
public function usedMemory(): int
|
||||
{
|
||||
$used = shell_exec("free -m | awk 'NR==2{ total=$2 ; used=$3 } END { print used/total*100}'");
|
||||
return floor(intval($used));
|
||||
}
|
||||
|
||||
public function usedDisk(): int
|
||||
{
|
||||
$output = shell_exec("df -h / | awk 'NR==2 {print $5}'");
|
||||
return intval(str_replace('%', '', trim($output)));
|
||||
}
|
||||
|
||||
public function processorCount()
|
||||
{
|
||||
$procs = shell_exec("nproc --all");
|
||||
|
||||
Reference in New Issue
Block a user