Prevent CPU number showing more than once on BSD
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; }
|
if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; }
|
||||||
}
|
}
|
||||||
if (stristr(PHP_OS, 'BSD')) {
|
if (stristr(PHP_OS, 'BSD')) {
|
||||||
$result = system("dmesg | grep -i --max-count 1 CPUs | sed 's/[^0-9]*//g'");
|
$result = shell_exec("dmesg | grep -i --max-count 1 CPUs | sed 's/[^0-9]*//g'");
|
||||||
$cpu_cores = trim($result);
|
$cpu_cores = trim($result);
|
||||||
}
|
}
|
||||||
if (stristr(PHP_OS, 'Linux')) {
|
if (stristr(PHP_OS, 'Linux')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user