I
I
Ivan Karabadzhak2015-03-02 09:27:10
linux
Ivan Karabadzhak, 2015-03-02 09:27:10

What is wrong with my bash script?

Task: after resume or thaw, run a script that, using the aticonfig utility, will reduce the speed of the video card cooler. During a normal start, the cooler spins at a speed of 20%. And if the computer starts up after suspend, then the cooler spins at a speed of 35%, which is quite loud.
Through aticonfig, you can set the speed of rotation of the cooler.

aticonfig --pplib-cmd "set fanspeed 0 N"

Where N is the rotation speed of the cooler, for example 10 (as a percentage).
I created the /etc/pm/sleep.d/10_fancontrol script and wrote the following code.
#!/bin/sh
case "${1}" in
resume|thaw)
exec aticonfig --pplib-cmd "set fanspeed 0 10"
;;
esac

But it did not help and after waking up my PC, the cooler still spins at a speed of 35%. This I find out with the command:
aticonfig --pplib-cmd "get fanspeed 0"

What's wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2015-03-02
@Jakeroid

Have you tried redirecting stdout and stderr to a file? Maybe aticonfig writes something about this. Is there anything strange in dmesg too?
As a hypothesis, the script works too early, after it someone else starts (for example, it is reinitialized when X starts) and resets the setting to default.
Didn't find out, 35% is the minimum default speed of your video card cooler or will it drop lower if you improve the cooling of the video card?
As a direct and reliable solution - to change the bios of the video card with a modified cooler control scheme.

E
Egor Kazantsev, 2015-03-02
@saintbyte

Whence such conviction that the script in general is executed?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question