diff --git a/powersave.sh b/powersave.sh index 16cbc41..c3be6d4 100644 --- a/powersave.sh +++ b/powersave.sh @@ -4,7 +4,7 @@ GOVERNOR="powersave" apply_lm=true while getopts 'hopPg:' opt; do - case opt in + case $opt in 'h') echo "Usage: powersave [-hopP] [-g governor]" echo " -h this message" @@ -30,8 +30,8 @@ while getopts 'hopPg:' opt; do GOVERNOR=$OPTARG apply_lm=false ;; + '?'|*) ;; esac - '' done shift $((OPTIND-1)) @@ -40,6 +40,7 @@ CPUS="$(nproc)" for c in $(seq 0 $((CPUS-1))) do echo $GOVERNOR > /sys/devices/system/cpu/"cpu$c"/cpufreq/scaling_governor + printf '[cpu %d] %s\n' "$c" "$(cat "/sys/devices/system/cpu/cpu$c/cpufreq/scaling_governor")" done