Guest User

Untitled

a guest
Jan 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/bin/bash
  2. TEMPERATURE=`cat /sys/class/thermal/thermal_zone0/temp`
  3.  
  4. function print_usage {
  5. echo "Usage: $0 [delay time in seconds]"
  6. }
  7.  
  8. SLEEP_TIME=2
  9. if [ "x$1" != "x" ]; then
  10. if [[ $1 == "-h" || $1 == "--help" ]]; then
  11. print_usage;
  12. exit 0;
  13. else
  14. SLEEP_TIME=$1;
  15. fi
  16. fi
  17.  
  18. while [ 1==1 ]; do
  19. echo "scale=1; $TEMPERATURE/1000" | bc;
  20. sleep $SLEEP_TIME;
  21. done;
Add Comment
Please, Sign In to add comment