WizardKit/archlive/airootfs/usr/local/bin/apple_fans
Alan Mason 542d584b4a 2017-08: Retroactive Updates
Switched to i3/dunst/rofi over xfce4

* Custom Repo overhaul
  * build-wk downloads, builds, and adds packages to the custom-repo
  * Dropped i686 support
* HW-Diag scripts should now "support" virtual drives
  * e.g. /dev/vda (for easier testing)
* Bugfix: removed resolv.conf symlink to fix NetworkManager
2017-12-06 17:58:58 -08:00

37 lines
744 B
Bash

#!/bin/bash
#
## HW diagnostics - Prime95
SMCPATH="/sys/devices/platform/applesmc.768"
SET_MAX="True"
function usage {
echo "Usage: $0 auto|max"
echo " e.g. $0 max"
}
# Set mode
case $1 in
auto)
SET_MAX="False";;
max)
SET_MAX="True";;
*)
usage
exit 1;;
esac
if [[ -e "$SMCPATH" ]]; then
if [[ "$SET_MAX" == "True" ]]; then
# Set fans to max RPM
for fan in $SMCPATH/fan*max; do
echo '1' | sudo tee ${fan:0:-4}_manual > /dev/null
cat $fan | sudo tee ${fan:0:-4}_output > /dev/null
done
else
# Set fans to auto
for fan in $SMCPATH/fan*manual; do
echo '0' | sudo tee $fan > /dev/null
done
fi
fi