Created
July 30, 2019 20:36
-
-
Save rkennesson/12208974e207375169bc7e02c66d423c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if ps aux | grep qemu | grep "guest="; then | |
mode='performance' | |
else | |
mode='powersave' | |
fi | |
cpus=$(grep -c processor /proc/cpuinfo 2>/dev/null) | |
date=$(date "+%d.%m.%Y %T") | |
echo "$date INFO: ${mode^^[p,s]} Mode Activated." | |
for ((i=0; i < cpus; ++i)); do | |
echo "/usr/bin/cpufreq-set -c $i -g $mode &>/dev/null" | |
done | |
#!/usr/bin/env bash | |
if ps aux | grep qemu | grep "guest="; then | |
mode='performance' | |
else | |
mode='powersave' | |
fi | |
cpus=$(grep -c processor /proc/cpuinfo 2>/dev/null) | |
date=$(date "+%d.%m.%Y %T") | |
echo "$date INFO: ${mode^^[p,s]} Mode Activated." | |
for ((i=0; i < cpus; ++i)); do | |
echo "/usr/bin/cpufreq-set -c $i -g $mode &>/dev/null" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment