From Electron Cloud
This script works with Gentoo on the Mac Mini with some modifications:
The modifications are due to the fact there are only 2 temperature sensors, one fan, and no battery, thus no need to mess with hdparm settings or to change behavior depending on whether the Mac is running on batteries; and Gentoo startup scripts are more concise than plain shell scripts.