Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


enable gpio output when boot is complete
#12
(01-08-2024, 09:18 PM)Wallyboy Wrote:
(01-07-2024, 09:23 PM)Nutul Wrote:
(01-07-2024, 09:09 PM)Wallyboy Wrote: Can I run them as root within a script file?  Not sure how to do that.
Just prepend sudo to the command; although that rings a bell... about the "echo" thing...
Maybe it's better you include the three commands in a shell script, and then invoke the script with:

sudo ./yourscript.sh

although I am not sure if that would wait for the password... maybe making "root" the script owner, and then setting its sticky flag would have better chances of running.

I'm having no luck with the sh script.  I would rather use a python script but I cannot figure out how to do the moodeutl test as described above..  I have attached the code snippet below as suggested for the sh script.  Anyone know how to implement this in python? 
Code:
until test $(moodeutl -q "select value from cfg_system where param='wrkready'") = "1"; do

Not in this very moment; but it is a program call, something in the lines of sysCall("moodeutl -q ... ") = "1", or exec(" ... ")...

wait a sec:

import subprocess

subprocess.run(["ls", "-l"])

1st element in the array is the program/command, and further ones are the arguments to such program.
Reply


Messages In This Thread
RE: enable gpio output when boot is complete - by Nutul - 01-08-2024, 09:46 PM

Forum Jump: