daily pastebin goal
76%
SHARE
TWEET

check-temperature.sh

ulfben Aug 10th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #check-temperature.sh - prints the value of all thermal sensors
  3. CELCIUS=$'\xc2\xb0'C
  4. for i in /sys/class/thermal/*/temp
  5. do
  6.         fileName="$i"
  7.         value=$(cat "$i")
  8.         value=$(echo "$value/1000.0" | bc) #basic calculator
  9.         printf "%s %.1f%s \\n" "$fileName" "$value" "$CELCIUS"
  10. done
RAW Paste Data
Top