summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/widgets/include
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-09 11:10:19 -0300
committerRenato Botelho <renato@netgate.com>2015-10-09 11:11:31 -0300
commit8822be67ce3085c30a1127960d6c8ae1d7eb1876 (patch)
tree2d8095a1a8869c21e6ebd5cec39c967b159bf7e2 /src/usr/local/www/widgets/include
parent3928c6f1bcf911097366f075994dc9a61716e6e3 (diff)
downloadpfsense-8822be67ce3085c30a1127960d6c8ae1d7eb1876.zip
pfsense-8822be67ce3085c30a1127960d6c8ae1d7eb1876.tar.gz
Ignore possible erroneously negative temperatures
It's based on 2 pull requests (#1800 and #1801) by nagyrobi
Diffstat (limited to 'src/usr/local/www/widgets/include')
-rw-r--r--src/usr/local/www/widgets/include/thermal_sensors.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr/local/www/widgets/include/thermal_sensors.inc b/src/usr/local/www/widgets/include/thermal_sensors.inc
index a6e727a..e6ddb58 100644
--- a/src/usr/local/www/widgets/include/thermal_sensors.inc
+++ b/src/usr/local/www/widgets/include/thermal_sensors.inc
@@ -20,8 +20,10 @@ $thermal_sensors_widget_title = "Thermal Sensors";
function getThermalSensorsData() {
$_gb = exec("/sbin/sysctl -a | grep temperature", $dfout);
- $thermalSensorsData = join("|", $dfout);
- return $thermalSensorsData;
+ $dfout_filtered = array_filter($dfout, function($v) {
+ return strpos($negsign, ' -') === false;
+ });
+ return join("|", $dfout_filtered);
}
?>
OpenPOWER on IntegriCloud