Duke's utils
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 lines
294 B

#!/usr/bin/perl -w
# Print cpu temperature on FreeBSD
# Jonathan Leto <jonathan@leto.net>
use strict;
my $tempf;
my $tempc = `sysctl hw.acpi.thermal.tz0.temperature`;
$tempc =~ m!(.*): (\d+.\d)C!g and $tempc = $2;;
$tempf = $tempc*9/5 + 32;
print "Temperature of cpu is $tempc C/$tempf F\n";