]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/System.php
Merge pull request #12316 from VVelox/load_fix
[friendica.git] / src / Core / System.php
index 8a8f273a8db7fdf2c9ef5402f22a4e19899f20fa..e0c23e55b9e4a9c1475cceee40bfbdb0abefddcd 100644 (file)
@@ -442,10 +442,10 @@ class System
         */
        public static function getLoadAvg(): array
        {
-               if (is_readable('/proc/loadavg')) {
+               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/.*averages*: //" | sed "s/,//g"');
                        }
                }