Last active
November 18, 2015 16:02
-
-
Save gsora/dc52c6f88a3de1e3ede9 to your computer and use it in GitHub Desktop.
Toggle between automatic and max fan speed on Retina MacBook Pros
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| SMC=/sys/devices/platform/applesmc.* | |
| MANUAL_VAL=$(cat $SMC/fan1_manual) | |
| MANUAL=$SMC/fan1_manual | |
| MIN=$(cat $SMC/fan1_min) | |
| MAX=$(cat $SMC/fan1_max) | |
| FOUT=$SMC/fan1_output | |
| if [[ $UID != 0 ]]; then | |
| echo "Run this script as root." | |
| else | |
| if [[ $MANUAL_VAL == 0 ]]; then | |
| echo 1 > $MANUAL | |
| echo $MAX > $FOUT | |
| else | |
| echo 0 > $MANUAL | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment