| DIR="/sys/devices/virtual/thermal" |
| [ `adb shell "[ -d $1 ] && echo found"` ] |
| [ `adb shell "[ -f $1 ] && echo found"` ] |
| echo "`adb shell cat $1 | tr -d '\r'`" |
| local ERROR=`getprop $1 | grep "Invalid"` |
| if [ ${#ERROR} -eq 0 ]; then |
| if [[ "`adb shell id | tr -d '\r' | awk -F'[()]' '{print $2}'`" != "root" ]]; then |
| echo Device: `adb shell getprop ro.product.model` |
| ZONES=`adb shell ls $DIR | tr -d '\r' | grep thermal_zone | tr -d thermal_zone | sort -n` |
| # print temperature of each zone |
| print_if_exists $DIR"/thermal_zone"$ZONE"/mode" MODE |
| print_if_exists $DIR"/thermal_zone"$ZONE"/temp" TEMP |
| print_if_exists $DIR"/thermal_zone"$ZONE"/type" TYPE |
| printf "Zone %02d: MODE=%-8s TEMP=%-5s TYPE=%s\n" $ZONE $MODE $TEMP $TYPE |
| if ! direxists $DIR; then |
| echo "Thermal directory not found" |