aboutsummaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorNicolas LLOBERA <nllobera@gmail.com>2017-03-20 17:35:14 +0100
committerNicolas LLOBERA <nllobera@gmail.com>2017-03-20 17:35:14 +0100
commitfffe83f2c73a2928e32c2c70ad788fea9a94d17a (patch)
tree552d53811c62002d9ae3f0cf3a890d2c88bf27a5 /libs
parent3b04b43e1792ee127ad4342384e3d6e6cc144445 (diff)
checks if the file exists before trying the command for the cpu temperature
Diffstat (limited to 'libs')
-rw-r--r--libs/cpu.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/cpu.php b/libs/cpu.php
index 9665c87..993e289 100644
--- a/libs/cpu.php
+++ b/libs/cpu.php
@@ -64,7 +64,7 @@ if ($frequency == 'N.A')
// CPU Temp
if ($Config->get('cpu:enable_temperature'))
{
- if (exec('/usr/bin/sensors | grep -E "^(CPU Temp|Core 0)" | cut -d \'+\' -f2 | cut -d \'.\' -f1', $t))
+ if (file_exists('/usr/bin/sensors') && exec('/usr/bin/sensors | grep -E "^(CPU Temp|Core 0)" | cut -d \'+\' -f2 | cut -d \'.\' -f1', $t))
{
if (isset($t[0]))
$temp = $t[0].' °C';
@@ -88,4 +88,4 @@ $datas = array(
'temp' => $temp,
);
-echo json_encode($datas); \ No newline at end of file
+echo json_encode($datas);