archrelease: copy trunk to community-any
[ArchLinux/community.git] / linux-tools / trunk / cpupower.systemd
blobc7266f01ff8d7a471c512b3e14157b4a3c0c28c4
1 #!/bin/bash
2 # Copyright © 2012, Sébastien Luttringer
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 declare -i fail=0
7 # parse frequency options
8 declare -a params=()
9 params+=(${governor:+-g $governor})
10 params+=(${min_freq:+-d $min_freq})
11 params+=(${max_freq:+-u $max_freq})
12 params+=(${freq:+-f $freq})
14 # apply frequency options
15 if ((${#params[@]} > 0)); then
16 cpupower frequency-set "${params[@]}" >/dev/null || fail=1
19 # parse cpu options
20 declare -a params=()
21 params+=(${mc_scheduler:+-m $mc_scheduler})
22 params+=(${smp_scheduler:+-s $smp_scheduler})
23 params+=(${perf_bias:+-b $perf_bias})
25 # apply cpu options
26 if ((${#params[@]} > 0)); then
27 cpupower set "${params[@]}" >/dev/null || fail=1
30 exit $fail
32 # vim:set ts=2 sw=2 ft=sh et: