diff options
Diffstat (limited to 'pm/sleep.d/94cpufreq')
-rwxr-xr-x | pm/sleep.d/94cpufreq | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pm/sleep.d/94cpufreq b/pm/sleep.d/94cpufreq index d956aa1..03fa09f 100755 --- a/pm/sleep.d/94cpufreq +++ b/pm/sleep.d/94cpufreq @@ -16,7 +16,7 @@ hibernate_cpufreq() # if our temporary governor is not available, skip. grep -q "$TEMPORARY_CPUFREQ_GOVERNOR" \ "$x/cpufreq/scaling_available_governors" || continue - savestate "${x}_governor" $(cat "$gov") + savestate "${x}_governor" < "$gov" echo "$TEMPORARY_CPUFREQ_GOVERNOR" > "$gov" done ) } @@ -26,9 +26,8 @@ thaw_cpufreq() ( cd /sys/devices/system/cpu/ for x in cpu[0-9]*/cpufreq/scaling_governor ; do [ -f "$x" ] || continue - local gov="$(restorestate "${x%%/*}_governor")" - [ -z "$gov" ] && continue - echo "$gov" > "$x" + state_exists "${x%%/*}_governor" || continue + restorestate "${x%%/*}_governor" > "$x" done ) } |