Skip to content

Instantly share code, notes, and snippets.

@0xF6
Last active August 26, 2023 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xF6/ca88fd943f7ff5b4d29eb1e6e815f4e5 to your computer and use it in GitHub Desktop.
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
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