First thing is first, you need to install lm-sensors and probe your hardware before this can work. If you haven’t seen that post yet, I recommend looking that over first before trying to write this script.
Now, I will include the script in this post. I suppose you could simply just copy the code and be done with it. However, I strongly encourage you follow along and see how this is done. I also recommend that you type out EVERYTHING. This will be the best way to start learning scripts in Linux. When ever I am given a script online that I want to “build” myself, I always type it out and try to dissect it line by line. This is one of the best ways to learn scripting in Linux. If you always copy it, it will be that much harder to learn scripting to make your own cool stuff. If you never have the desire to write your own scripts then by all means copy the code.
Code to be inserted into a text file and changed to an executable is:
while [ $x -lt 10 ]