aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/wmsl-temp
blob: bb1684e216310df6dc4298ffd073f598abc418e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# Display CPU temperature

for zone in /sys/class/thermal/thermal_zone*/temp; do
	[ -f "$zone" ] || continue
	temp=$(cat "$zone" 2>/dev/null)
	if [ -n "$temp" ] && [ "$temp" -gt 0 ]; then
		printf "TEMP %d°C" $((temp / 1000))
		exit 0
	fi
done

printf "N/A"