123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #!/usr/bin/env bash
- [ "x${DEBUG+set}" = 'xset' ] && set -v
- set -u -e
- if [ $EUID -ne 0 ]; then
- printf "This script must be run as root\n"
- exit 1
- fi
- apt-get -y install powertop
- update-rc.d powertop remove
- rm -Rf "/etc/init.d/powertop"
- printf "#!/bin/sh\n" > "/etc/init.d/powertop"
- printf "/usr/sbin/powertop --auto-tune\n" >> "/etc/init.d/powertop"
- chmod +x "/etc/init.d/powertop"
- update-rc.d powertop defaults
- powertop --auto-tune
- printf "Done. Run 'powertop --auto-tune' now. This will also run automatically at boot time. Run it again at any time, if needed. This has also been done for you just now.\n"
|