From f66420815793015db113315f28c4ef1931c304bb Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Sat, 3 Dec 2022 04:24:49 -0600 Subject: [PATCH 1/3] get the load average in a portable manner --- src/Core/System.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/System.php b/src/Core/System.php index b2da78f1b3..dbf49b38db 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -445,7 +445,7 @@ class System if (@is_readable('/proc/loadavg')) { $content = @file_get_contents('/proc/loadavg'); if (empty($content)) { - $content = shell_exec('cat /proc/loadavg'); + $content = shell_exec('uptime | sed "s/.*e: //" | sed "s/,//"'); } } From edaff99307347991a5b0f198cb3643daf5e6682f Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Sat, 3 Dec 2022 04:31:04 -0600 Subject: [PATCH 2/3] derp, minor fix --- src/Core/System.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/System.php b/src/Core/System.php index dbf49b38db..31f17a9058 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -445,7 +445,7 @@ class System if (@is_readable('/proc/loadavg')) { $content = @file_get_contents('/proc/loadavg'); if (empty($content)) { - $content = shell_exec('uptime | sed "s/.*e: //" | sed "s/,//"'); + $content = shell_exec('uptime | sed "s/.*averages*: //" | sed "s/,//"'); } } From 8f82fb9a2203e6c4405c3fa5980cb59c044376e3 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Sat, 3 Dec 2022 04:34:17 -0600 Subject: [PATCH 3/3] now with g --- src/Core/System.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/System.php b/src/Core/System.php index 31f17a9058..e0c23e55b9 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -445,7 +445,7 @@ class System if (@is_readable('/proc/loadavg')) { $content = @file_get_contents('/proc/loadavg'); if (empty($content)) { - $content = shell_exec('uptime | sed "s/.*averages*: //" | sed "s/,//"'); + $content = shell_exec('uptime | sed "s/.*averages*: //" | sed "s/,//g"'); } }