-my @querry = split(/\?/,$ENV{'QUERY_STRING'});
-$querry[0] = '' unless defined $querry[0];
-$querry[1] = 'hour' unless defined $querry[1];
-
-if ( $querry[0] =~ "hwtemp"){
- print "Content-type: image/png\n\n";
- binmode(STDOUT);
- &Graphs::updatehwtempgraph($querry[1]);
-}elsif ( $querry[0] =~ "hwfan"){
- print "Content-type: image/png\n\n";
- binmode(STDOUT);
- &Graphs::updatehwfangraph($querry[1]);
-}elsif ( $querry[0] =~ "hwvolt"){
- print "Content-type: image/png\n\n";
- binmode(STDOUT);
- &Graphs::updatehwvoltgraph($querry[1]);
-}elsif ( $querry[0] =~ "thermaltemp"){
- print "Content-type: image/png\n\n";
- binmode(STDOUT);
- &Graphs::updatethermaltempgraph($querry[1]);
-}elsif ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" ){
- print "Content-type: image/png\n\n";
- binmode(STDOUT);
- &Graphs::updatehddgraph($querry[0],$querry[1]);
-}else{
- &Header::showhttpheaders();
- &Header::openpage($Lang::tr{'harddisk temperature graphs'}, 1, '');
- &Header::openbigbox('100%', 'left');
-
- &Header::getcgihash(\%sensorsettings);
-
- if ( $sensorsettings{'ACTION'} eq $Lang::tr{'save'} ) {
- foreach(@sensorsgraphs){
- chomp($_);
- $_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
- my $label = $2.$3;$label=~ s/-//g;
- if ( $sensorsettings{'LINE-'.$label} ne "on" ){$sensorsettings{'LINE-'.$label} = 'off';}
- elsif ( $sensorsettings{'LINE-'.$label} eq "on" ){$sensorsettings{'LINE-'.$label} = 'checked';}
- }
- &General::writehash("${General::swroot}/sensors/settings", \%sensorsettings);
+# Look for ACPI Thermal Zone sensors.
+my @thermal_zone_sensors = grep(/thermal-thermal_zone/, @sensor_dirs);
+
+# If a thermal zone sensor has been found add it to the sensorsgraphs array.
+if (@thermal_zone_sensors) {
+ # Loop through the array of thermal zone sensors.
+ foreach my $thermal_zone_sensor (@thermal_zone_sensors) {
+ # Add the sensor to the array.
+ push(@sensorsgraphs, "$sensorsdir/$thermal_zone_sensor");