aboutsummaryrefslogtreecommitdiff
path: root/local/bin/asus-fan
blob: 09e54f1f9f488204c77c973f499983ee6683f6bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# TODO this probably should be auto detected, because hwmon number can change
HWMON=/sys/devices/platform/asus-nb-wmi/hwmon/hwmon1

if [ "$(whoami)" != "root" ]; then
	echo "Run $0 only with root privileges"
	exit -1
fi

case "$1" in
	-h|--help)
		echo "Usage: $0 -h|full|auto"
		echo "This script controls asus hwmon"
		echo " full - Full throttle"
		echo " auto - Automatic hardware control"
		;;
	full)
		echo 1 > $HWMON/pwm1_enable
		echo 255 > $HWMON/pwm1
		;;
	auto)
		echo 0 > $HWMON/pwm1_enable
		;;
	*)
		echo "Unknown or no option given!"
		exit -2
		;;
esac