Prevent CPU number showing more than once on BSD

This commit is contained in:
FusionPBX 2023-07-22 09:50:11 -06:00 committed by GitHub
parent 7dd146689f
commit 1bbe9b2f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@
if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; }
}
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);
}
if (stristr(PHP_OS, 'Linux')) {
@ -162,4 +162,4 @@
echo "<span class='hud_expander' onclick=\"$('#hud_system_cpu_status_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>";
echo "</div>\n";
?>
?>