jpajk
9/8/2017 - 2:29 PM

cpusage

cpusage

#!/bin/bash
COUNTER=0
CPU=$(grep -c ^processor /proc/cpuinfo)
if [ "$1" > 800 ] || [ "$1" <= 3100 ]; then
    while [  $COUNTER -lt $CPU ]; do
            sudo cpufreq-set -c $COUNTER -u $1Mh
        let COUNTER=COUNTER+1 
    done
    cpufreq-info | grep policy
else
    echo 'Not a valid CPU speed.  Must be between 800 and 3100 Mhz'
fi