Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ "$1" =~ ^(powersave|performance)$ ]]; then
- #echo "$1 is in the list"
- n_cpus=`nproc --all`
- echo "Found $n_cpus cores"
- let upper_limit=$n_cpus-1
- #echo $upper_limit
- echo "Setting the CPU to \"$1\" mode"
- for i in $(seq 0 1 $upper_limit)
- do
- `cpufreq-set -c $i -g $1`
- done
- else
- echo "Usage: ./set_cpu.sh \"governor\". governor should be either \"powesave\" or \"performance\" (without the quotes)"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement