Skip to content

Commit

Permalink
Use numeric values for CPU temperature (#23)
Browse files Browse the repository at this point in the history
Fixes #20 and #21
  • Loading branch information
cocide authored Sep 4, 2022
1 parent 7470b35 commit 06ccffb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions get-system-temps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ sub display_cpu_temps
for (my $core=0; $core < $cpucores; $core++)
{
$temp = qx(sysctl -n dev.cpu.$core.temperature);
$temp =~ s/[^\-[:digit:]\.]//g;
chomp($temp);
if ($temp <= 0)
{
Expand Down

0 comments on commit 06ccffb

Please sign in to comment.