dimmuboy

HDD Temp for conky

Mar 24th, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.41 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. temp="`hddtemp /dev/sda -n 2>/dev/null`"
  4. if [[ $temp = [0-9][0-9] ]]; then
  5.    if [ $temp -gt 40 ]; then
  6.       echo '${color orange}${exec hddtemp /dev/sda | cut -d ':' -f 2- | cut -c 2-}${color}'
  7.    else
  8.       echo "`hddtemp /dev/sda | cut -d ':' -f 2- | cut -c 2-`"
  9.    fi
  10. fi
  11.  
  12. temp="`hddtemp /dev/sdb -n 2>/dev/null`"
  13. if [[ $temp = [0-9][0-9] ]]; then
  14.    if [ $temp -gt 40 ]; then
  15.       echo '${color orange}${exec hddtemp /dev/sdb | cut -d ':' -f 2- | cut -c 2-}${color}'
  16.    else
  17.       echo "`hddtemp /dev/sdb | cut -d ':' -f 2- | cut -c 2-`"
  18.    fi
  19. fi
  20.  
  21. temp="`hddtemp /dev/sdc -n 2>/dev/null`"
  22. if [[ $temp = [0-9][0-9] ]]; then
  23.    if [ $temp -gt 40 ]; then
  24.       echo '${color orange}${exec hddtemp /dev/sdc | cut -d ':' -f 2- | cut -c 2-}${color}'
  25.    else
  26.       echo "`hddtemp /dev/sdc | cut -d ':' -f 2- | cut -c 2-`"
  27.    fi
  28. fi
  29.  
  30. temp="`hddtemp /dev/sdd -n 2>/dev/null`"
  31. if [[ $temp = [0-9][0-9] ]]; then
  32.    if [ $temp -gt 40 ]; then
  33.       echo '${color orange}${exec hddtemp /dev/sdd | cut -d ':' -f 2- | cut -c 2-}${color}'
  34.    else
  35.       echo "`hddtemp /dev/sdd | cut -d ':' -f 2- | cut -c 2-`"
  36.    fi
  37. fi
  38.  
  39. temp="`hddtemp /dev/sde -n 2>/dev/null`"
  40. if [[ $temp = [0-9][0-9] ]]; then
  41.    if [ $temp -gt 40 ]; then
  42.       echo '${color orange}${exec hddtemp /dev/sde | cut -d ':' -f 2- | cut -c 2-}${color}'
  43.    else
  44.       echo "`hddtemp /dev/sde | cut -d ':' -f 2- | cut -c 2-`"
  45.    fi
  46. fi
Advertisement
Add Comment
Please, Sign In to add comment