]> git.mxchange.org Git - friendica.git/commitdiff
get the load average in a portable manner
authorZane C. Bowers-Hadley <vvelox@vvelox.net>
Sat, 3 Dec 2022 10:24:49 +0000 (04:24 -0600)
committerZane C. Bowers-Hadley <vvelox@vvelox.net>
Sat, 3 Dec 2022 10:24:49 +0000 (04:24 -0600)
src/Core/System.php

index b2da78f1b3509d9a2ff5f16d147d1efd42c45e3e..dbf49b38db18af1971c7e2daee05f67cb4a5fabb 100644 (file)
@@ -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/,//"');
                        }
                }