-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christian Kujau <[email protected]>
new file: sensors_adt746x.sh
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |