Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Poor man's fan control for Macbooks that run Linux.
#!/usr/bin/env bash
set -e
minimum=2000
medium=4500
maximum=6200
value=$minimum
case "$1" in
"min")
value=$minimum
;;
"med")
value=$medium
;;
"max")
value=$maximum
;;
*)
value=$1
;;
esac
if [[ -z "$(echo $value | grep -P '^\d+$')" ]]
then
echo 'Only numeric values can be specified'
exit 1
fi
echo $value | sudo tee /sys/devices/platform/applesmc.768/fan1_min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.