Page 1 of 1

How do I read a value from a system path?

Posted: 03 Oct 2016 17:17
by GollyJer
I want to get the value (1 or 0) from this path.

Code: Select all

/sys/devices/virtual/graphics/fb0/hbm
I've messed around with Execute Root but am not getting it right.

Thanks!

Re: How do I read a value from a system path?

Posted: 04 Oct 2016 19:25
by Martin
Hi,

You could probably use action Execute Root Command with command cat /sys/devices/virtual/graphics/fb0/hbm and then check the contents of variable stdout.
The result likely contains the value and a newline so following script in condition Expression could be used to check if the output is 0: trim(stdout)=="0"

Regards,
Martin

Re: How do I read a value from a system path?

Posted: 05 Oct 2016 03:52
by GollyJer
That worked perfectly. Thanks!

Re: How do I read a value from a system path?

Posted: 08 Oct 2016 06:27
by john.lasdas
Thank you GollyJer and Martin,

This solved the half of my problem too.

The other half problem is how I can modify the value of a path like this... (e.g. from Y to N) :?

Thanks

Re: How do I read a value from a system path?

Posted: 08 Oct 2016 15:01
by GollyJer
Hi John. Try this

Code: Select all

echo {your_desired_value} > /sys/devices/virtual/graphics/fb0/hbm

Re: How do I read a value from a system path?

Posted: 08 Oct 2016 15:35
by john.lasdas
GollyJer wrote:Hi John. Try this

Code: Select all

echo {your_desired_value} > /sys/devices/virtual/graphics/fb0/hbm

Thank you GollyJer,

Tried it with execute root command and it worked!