Been banging my head trying to understand how building a plugin works, and I tell you is hard and that is because the documentation is old and not relevant anymore.
Now I finally managed to get to the point where i actually need to execute some shell commands from the rpc file, yet the command that works well in cli refuses to be executed by rpc.
So to give an example:
I have a script in ~/scripts/myscript.sh
This script has a method in it names runTest that accepts one argument.
Running this command from terminal like this and works:
source ~/scripts/myscript.sh && runtTest "blabla"
Now if I try to run this command from rpc with the following code:
$cmd = 'source ~/scripts/myscript.sh && runtTest "blabla"';
$process = new \OMV\System\Process($cmd);
$process->execute();But every darn time I get this error: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; source ~/scripts/myscript.sh && runtTest "blabla"' with exit code '127':
Any suggestions ?