turbo-boost.sh 346 Bytes
Newer Older
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
#!/bin/sh

# activate or deactivate turbo boost

self="$0"

die() {
	echo >&2 "$@"
	exit 1
}

usage() {
	die "usage: $self [a|d]"
}

uid=$(id -u)

if [ "$uid" -ne 0 ]; then
	die "not root"
fi

case "$1" in
a*) echo 0 >/sys/devices/system/cpu/intel_pstate/no_turbo ;;
d*) echo 1 >/sys/devices/system/cpu/intel_pstate/no_turbo ;;
*) usage ;;
esac