diff --git a/include/sysinfo.php b/include/sysinfo.php index 1532b9e..c09724a 100644 --- a/include/sysinfo.php +++ b/include/sysinfo.php @@ -1,8 +1,16 @@ TEMPERATUREHIGHLEVEL) { + $cputemp = NULL; + $cpufreq = NULL; + if (file_exists ("/sys/class/thermal/thermal_zone0/temp")) { + exec("cat /sys/class/thermal/thermal_zone0/temp", $cputemp); + $cputemp = $cputemp[0] / 1000; + } + if (file_exists ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq")) { + exec("cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", $cpufreq); + $cpufreq = $cpufreq[0] / 1000; + } + + if (defined("TEMPERATUREALERT") && $cputemp > TEMPERATUREHIGHLEVEL && $cputemp !== NULL) { ?>