diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2009-01-08 11:37:23 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2009-01-08 11:37:23 +0100 |
commit | b5593ec19bf693c55e35f88bbce7b45a1381d986 (patch) | |
tree | 35e067becdedc71a10b70656bc6c9dac3f2d20e6 /sbin/set_governor | |
download | helper-scripts-b5593ec19bf693c55e35f88bbce7b45a1381d986.tar.gz helper-scripts-b5593ec19bf693c55e35f88bbce7b45a1381d986.tar.xz helper-scripts-b5593ec19bf693c55e35f88bbce7b45a1381d986.zip |
added some usefull scripts
bin/Xshutdown.sh - graphical script for shutdown/reboot/standby
sbin/set_governor - set the governor of both cpus
sbin/keyword_package - adds a package to /etc/portage/packages.keywords
sbin/asound_backup.sh - creates a backup of /etc/asound.conf
sbin/asound_pulse_disable.sh - removes the default references to pulse
sbin/asound_pulse_enable.sh - adds pcm.!default und ctl.!default references to pulse
Diffstat (limited to 'sbin/set_governor')
-rwxr-xr-x | sbin/set_governor | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sbin/set_governor b/sbin/set_governor new file mode 100755 index 0000000..08f68e5 --- /dev/null +++ b/sbin/set_governor @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Script to display and set (checked) the governors for the both CPU Cores (f.e. from the Core2Duo) +# (c) Alexander Sulfrian 2007 +# Licence: GPL v3 +# + + +if [ -z "$1" ] +then + activ_governor_cpu0=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` + activ_governor_cpu1=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor` + echo "active governors" + echo "CPU 0: ${activ_governor_cpu0}" + echo "CPU 1: ${activ_governor_cpu1}" + exit 1 +fi + + +governor_avalible=`sed 's/ \(.\)/\n\1/g;s/ $//g' /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep "^${1}\$"` +if [ -z "$governor_avalible" ] +then + avalible_governors=`sed 's/ \(.\)/|\1/g;s/ $//g' /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors` + echo "Usage:" + echo "$0 [${avalible_governors}]" + exit 2 +fi + +echo "$1" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor +echo "$1" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor + +activ_governor_cpu0=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` +activ_governor_cpu1=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor` +echo "active governors" +echo "CPU 0: ${activ_governor_cpu0}" +echo "CPU 1: ${activ_governor_cpu1}" +exit 0 |