Last active
August 26, 2023 20:13
-
-
Save 0xF6/ca88fd943f7ff5b4d29eb1e6e815f4e5 to your computer and use it in GitHub Desktop.
force half cpu power for homemade servers when main work PC is offline
This file contains 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
if ping -c 1 10.10.10.254 &> /dev/null | |
then | |
if [ ! -f /tmp/cpu.up.status ]; then | |
cpupower frequency-set -u 3200Mhz | |
touch /tmp/cpu.up.status | |
if [ -f /tmp/cpu.down.status ]; then | |
rm -rf /tmp/cpu.down.status | |
fi | |
fi | |
else | |
if [ ! -f /tmp/cpu.down.status ]; then | |
cpupower frequency-set -u 2400Mhz | |
touch /tmp/cpu.down.status | |
if [ -f /tmp/cpu.up.status ]; then | |
rm -rf /tmp/cpu.up.status | |
fi | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment