made thermal.sh command have the zone be configurable.
This commit is contained in:
+4
-1
@@ -1,8 +1,11 @@
|
||||
!/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
# degrees in C
|
||||
THERMAL_ALERT=75
|
||||
|
||||
# see: /sys/class/thermal/thermal_zone*
|
||||
THERMAL_ZONE=0
|
||||
|
||||
STORAGE_MONITOR=("/")
|
||||
|
||||
# must declare associated array explicitly
|
||||
|
||||
+6
-2
@@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
LOCATION=`dirname "$0"`
|
||||
|
||||
source "${LOCATION}/config.sh"
|
||||
|
||||
# this is currently specific to raspberry-pi
|
||||
# since that is the only kind of physical server I have
|
||||
# TODO make this work with all temp in class/thermal
|
||||
name=$(</sys/class/thermal/thermal_zone0/type)
|
||||
mc=$(</sys/class/thermal/thermal_zone0/temp)
|
||||
name=$(</sys/class/thermal/thermal_zone${THERMAL_ZONE}/type)
|
||||
mc=$(</sys/class/thermal/thermal_zone${THERMAL_ZONE}/temp)
|
||||
|
||||
c=`echo "scale=1 ; $mc / 1000.0" | bc -l`
|
||||
f=`echo "scale=1 ; $c * 9 / 5 + 32" | bc -l`
|
||||
|
||||
Reference in New Issue
Block a user