Skip to content
Snippets Groups Projects
Commit 817044a5 authored by Bob Mottram's avatar Bob Mottram
Browse files

Check that cpu temperature can be detected

parent c26e9a4d
No related branches found
No related tags found
No related merge requests found
......@@ -1504,9 +1504,11 @@ function update_system_monitor {
used_memory_percent=$((used_memory * 100 / total_memory))
cpu_temperature=0
cpu_temp=$(cat /sys/class/thermal/thermal_zone*/temp | head -n 1)
if [ "$cpu_temp" ]; then
cpu_temperature=$((cpu_temp / 1000))
if [ -f /sys/class/thermal/thermal_zone0/temp ]; then
cpu_temp=$(cat /sys/class/thermal/thermal_zone*/temp | head -n 1)
if [ "$cpu_temp" ]; then
cpu_temperature=$((cpu_temp / 1000))
fi
fi
test_drive=/dev/sda1
......
......@@ -753,9 +753,11 @@ function webadmin_update_system_monitor {
used_memory_percent=$((used_memory * 100 / total_memory))
cpu_temperature=0
cpu_temp=$(cat /sys/class/thermal/thermal_zone*/temp | head -n 1)
if [ "$cpu_temp" ]; then
cpu_temperature=$((cpu_temp / 1000))
if [ -f /sys/class/thermal/thermal_zone0/temp ]; then
cpu_temp=$(cat /sys/class/thermal/thermal_zone*/temp | head -n 1)
if [ "$cpu_temp" ]; then
cpu_temperature=$((cpu_temp / 1000))
fi
fi
test_drive=/dev/sda1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment