Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- red=$'\033[1;31m'
- cyan=$'\033[1;36m'
- white=$'\033[1;37m'
- #
- ######### Checking some neccesary staff #########
- if [ $(whoami) != "root" ]; then
- echo -e "\aYou can't run this script without being root or an sudoer :)"
- exit 1
- fi
- which sensors >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo -e "\aCan't proceed. Is lm_sensors installed?"
- exit 1
- fi
- which hddtemp >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo -e "\aCan't proceed. Is hddtemp installed?"
- exit 1
- fi
- ######### Getting some Values #########
- _CPU1_TEMP=$(sensors|egrep -i '\w+\s+[0-9]'|awk '(NR<2){print $3}' )
- _CPU2_TEMP=$(sensors|egrep -i '\w+\s+[0-9]'|awk '(NR>1){print $3}')
- _DISK=$(df|egrep -o '/dev/\w{3}'|head -1)
- #
- echo -e ${white}"##########################################"
- echo -e ${cyan}" ...:: Temps for your machine ::..."
- echo -e ${white}"##########################################"
- echo -e ${red}"------------------------------------------"
- echo -e ${cyan}" CPU1 TEMP: $_CPU1_TEMP "
- echo -e ${cyan}" CPU2 TEMP: $_CPU2_TEMP "
- echo -e ${red}"------------------------------------------"
- echo -e ${cyan}" $(hddtemp $_DISK | awk '{print $2 " " $3 " " "=>" " " $NF}')"
- echo -e ${white}"##########################################"
Advertisement
Add Comment
Please, Sign In to add comment