Friday, August 29, 2014

Monitor Temperature in Mac using bash script command line

The code is simple thanks to the temperature monitor app
Just do ./runTapp.sh &
in the terminal, and you are good to go!
#!/bin/sh
cd /Applications/TemperatureMonitor.app/Contents/MacOS/
./tempmonitor -th > ~/Desktop/CPUtempData.csv
while true
do
    ./tempmonitor -tv >> ~/Desktop/CPUtempData.csv
    /bin/sleep 60
done

Reference:
http://www.bresink.com/osx/216202/Docs-en/commandline.html

No comments: