Skip to content

Commit

Permalink
Signed-off-by: Christian Kujau <[email protected]>
Browse files Browse the repository at this point in the history
	new file:   sensors_adt746x.sh
  • Loading branch information
ckujau committed Nov 4, 2011
1 parent e5067ba commit a19641a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions sensors_adt746x.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh
#
# (c) 2009, [email protected]
# therm_adt746x cannot be queried via i2c, so
# we're not using lm_sensors but this little script
#
renice 10 $$ > /dev/null
BASE=/sys/devices/temperatures

case $1 in
-s|--short)
echo "CPU: $(cat $BASE/sensor1_temperature) ($(awk '/^clock/ {print $3}' /proc/cpuinfo \
| sed 's/\.[0-9]*//')) Fan: $(sed 's/.*(//;s/ rpm)$//' \
< $BASE/sensor1_fan_speed) GPU: $(cat $BASE/sensor2_temperature)"
;;

-b)
# If pmu_battery is present
find /sys/ -type f | grep batte | egrep -v 'uevent|srcversion|initstate|refcnt|sections/\.|autosuspend_delay_ms|note.gnu.build' | \
xargs grep . | sed 's/.*pmu-battery.[0-9]\///;s/:/ /'
;;

-h)
echo "Usage: `basename $0` [-s] ....print short summary"
echo " [-b] ....print battery status"
echo " [-h] ....print this help text"
echo "With no arguments supplied, we will print out a long summary."
;;

*)
for p in $BASE/sensor1_location \
$BASE/sensor1_fan_speed \
$BASE/sensor1_temperature \
$BASE/sensor1_limit \
$BASE/sensor2_location \
$BASE/sensor2_temperature \
$BASE/sensor2_limit; do
echo "$(basename $p) $(cat $p)"
done
# As a bonus, print our current clockspeed
awk '/^clock/ {print $1" "$3}' /proc/cpuinfo
;;
esac

0 comments on commit a19641a

Please sign in to comment.