Skip to content

Instantly share code, notes, and snippets.

View qxzg's full-sized avatar

Hale Sun qxzg

  • Beijing university of Technology
  • Beijing, China
View GitHub Profile
#! /bin/sh
while true
do
echo " CPU temp :"
sysctl -a |egrep -E "cpu\.[0-9]+\.temp"
echo
echo " HDD temp :"
for i in $(sysctl -n kern.disks)
do
DevTemp=`smartctl -a /dev/$i | awk '/Temperature_Celsius/{print $0}' | awk '{print $10 "C"}'`