From 06ccffb9710b3d372ccefe0de4b093e00cb2a00c Mon Sep 17 00:00:00 2001 From: cocide Date: Sun, 4 Sep 2022 16:53:11 -0500 Subject: [PATCH] Use numeric values for CPU temperature (#23) Fixes Spearfoot/FreeNAS-scripts#20 and Spearfoot/FreeNAS-scripts#21 --- get-system-temps.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/get-system-temps.pl b/get-system-temps.pl index 02faf43..0bfddb8 100644 --- a/get-system-temps.pl +++ b/get-system-temps.pl @@ -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) {