Setting LED light and CPU governor via shell commands


I’m trying to toggle the LED light and change the CPU governor via shell commands.
The only thing I found is this here: and following lines.

So I tried writing 255 to /sys/class/leds/led-sys/brightness to turn the LED on and 0 to turn it off.
This works, but as far as I understand C++, that line is writing 0 or 1, not 255, so I wanted to make sure that it is correct and I won’t break anything.

Same thing for the governor, I could write ondemand or powersave to /sys/devices/system/cpu/cpuX/cpufreq/scaling_governor(where X is 0 to 3), but I’m wondering if that would be the right way to do it or I’m missing something.


EDIT: nevermind, the LED actually works as expected: 1 for off, 0 for on!


Why are you trying to change the CPU governor?


I decided to stop the mediacenter service when I’m not using it, so I’d also like to set the governor to powersave and set it back to ondemand when I start the service again.
What I wrote in the OP works, could there be issues with that?

Use 0/1 to control the LED.
They’re inverted in DT so that the red light is off by default.

Got it, everything works!
Thank you