diff options
| author | Anton Bobov <anton@bobov.name> | 2024-03-05 22:18:49 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2024-03-05 22:25:05 +0500 |
| commit | e2917305c959106ab01018b4c768505fb2f655ac (patch) | |
| tree | 55079dff911c81a5f9dbb84f3e584353a74c28ad /cpufreq | |
| parent | c1c648cabb419a0f281e32685287ca1e07e9271f (diff) | |
Updates
Diffstat (limited to 'cpufreq')
| -rwxr-xr-x | cpufreq | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +#!/bin/bash +# From: https://github.com/fmarier/root-scripts/blob/master/cpufreq +# +# Usage: +# +# cpufreq +# cpufreq performance +# cpufreq powersave + +if [ "z$1" = "z" ] ; then + cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + exit 0 +fi + +VALID="$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)" +for valid in $VALID ; do + if [ "$1" = "$valid" ] ; then + for cpu in /sys/devices/system/cpu/cpu[0-9]* ; do + echo "$valid" > "$cpu/cpufreq/scaling_governor" + done + exit 0 + fi +done + +echo "Invalid parameter. Valid governors are: $VALID" +exit 1 |
