What's wrong with my bash script?

Problem: after resume or thaw to run the script with the aticonfig utility will reduce the fan speed of the graphics card. During a normal start, the cooler is spinning at a rate of 20%. But if the computer starts after the suspend, the cooler is spinning at a speed of 35%, which is quite loud.

Using aticonfig to set the rotation speed of the cooler.
aticonfig --pplib-cmd "set fanspeed 0 N"

Where N is the rotation speed of the cooler, for example, 10 (in percent).

I created a script /etc/pm/sleep.d/10_fancontrol and wrote the following code.
#!/bin/sh

case "${1}" in
resume|thaw)
exec aticonfig --pplib-cmd "set fanspeed 0 10"
;;
esac


But it didn't help and after waking up my PC, the cooler is still spinning at a speed of 35%. I recognize this with the command:
aticonfig --pplib-cmd "get fanspeed 0"


What's wrong?
September 19th 19 at 00:23
2 answers
September 19th 19 at 00:25
Solution
Tried stdout and stderr redirect to a file? Maybe aticonfig something writes about it. In dmesg nothing too strange?

On the rights of the hypothesis - the script is triggered too early, after it starts someone else (for example, preinitialized when you start x) and resets to default.

Figured out, 35% is the minimum default fan speed of your graphics card or drop below if you improve the cooling of the graphics card?
As a solution to the forehead and securely - to alter a BIOS of the video card with a modified control scheme for the cooler.
easier to disconnect the cooler ;) - Carrie_Reynolds commented on September 19th 19 at 00:28
About stdout and stderr not tried. About 35% of the Yes default. But after suspend it is not reset below. But after downloading the usual - 20%. To alter the BIOS does not really want to, I still use Windows too. - Keon.Graham commented on September 19th 19 at 00:31
> To alter the BIOS does not really want to, I still use Windows too.
What relationship is there? I understand the fear to screw up something, but the firmware is adjusting in the BIOS as some times allows to abstract from the OS. - kamron.Upton66 commented on September 19th 19 at 00:34
: I do not want to change some BIOS just for Linux. - Keon.Graham commented on September 19th 19 at 00:37
September 19th 19 at 00:27
From this conviction that the script actually runs?
I added the command touch /home/jakeroid/Desktop/111.txt and the file appeared. - Carrie_Reynolds commented on September 19th 19 at 00:30
But if you mean correctness, I made the same (without conditions of course) and run manually - worked. - Keon.Graham commented on September 19th 19 at 00:33

Find more questions by tags LinuxUbuntu