From 3b35f5a0c64b0bf4538fa9808a7fbdd2e1ef44b0 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 21 Jun 2025 01:55:22 -0700 Subject: [PATCH] Add usedDisk() public method --- src/RaspAP/System/Sysinfo.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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");