diff --git a/src/RaspAP/System/Sysinfo.php b/src/RaspAP/System/Sysinfo.php index d8391944..0e636709 100755 --- a/src/RaspAP/System/Sysinfo.php +++ b/src/RaspAP/System/Sysinfo.php @@ -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");