X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSystem.php;h=e0c23e55b9e4a9c1475cceee40bfbdb0abefddcd;hb=82972744a9cb77ca3d2f8db289e97fee2709ebd7;hp=0c1e499d939395ac82ec2c5a05451d9873da95a1;hpb=e1341b6ad3b51ee849217cba8c1326e4aaec39b8;p=friendica.git diff --git a/src/Core/System.php b/src/Core/System.php index 0c1e499d93..e0c23e55b9 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -442,10 +442,13 @@ class System */ public static function getLoadAvg(): array { - $content = @file_get_contents('/proc/loadavg'); - if (empty($content)) { - $content = shell_exec('cat /proc/loadavg'); + if (@is_readable('/proc/loadavg')) { + $content = @file_get_contents('/proc/loadavg'); + if (empty($content)) { + $content = shell_exec('uptime | sed "s/.*averages*: //" | sed "s/,//g"'); + } } + if (empty($content) || !preg_match("#([.\d]+)\s([.\d]+)\s([.\d]+)\s(\d+)/(\d+)#", $content, $matches)) { $load_arr = sys_getloadavg(); if (empty($load_arr)) {