i´m trying to run an .sh file from my python skript to manually start a synch process with clone.
is there an easy way?
I tryed:
os.system('sudo su')
os.system('cd /home/pi/Desktop/webcam')
os.system('./clone.sh')
but after the first comand nothing happens.
Thanks
Each
system()call forks off a child process and then waits for it to finish. The child does stuff and then exits. Your initialsuchanged UID to zero in the child, and then it exited, so the zero UID was lost with death of the child. Thecdthen changed CWD in the child, and when it exits, again we find there's no effect on the parent and no effect on subsequent commands. By the time you run the clone script, it's running with wrong UID and wrong CWD.You want this:
(Or perhaps
sudo bash clone.sh, if there's no#!shebang.)EDIT
Feel free to limit the CWD change to just the child, if desired.