I think this is the best way to run Termux commands with Automate.
- you can send parameters and receive the stdout, stderr and exitcode of the scripts.
- You can install and use any package from termux, like NodeJS or Python.
- You have to install the Termux:Tasker plugin.
1) Go to Playstore and install Termux.
2a) Go to FDroid and install the Termux:Tasker plugin. https://f-droid.org/en/packages/com.termux.tasker/
2b) You can also install Termux:Tasker from the playstore but it costs like 2 dollars.
3) Open Termux and run: mkdir -p ~/.termux/tasker
4) Create a shell script with: nano ~/.termux/tasker/test.sh
The following two lines are the content of the test.sh script from this example:
##### begin test.sh
##### end test.sh
5) Give execution permission to the script with running: chmod u+x ~/.termux/test.sh
6) Check out the content of this flow
IMPORTANT: The reason behind the expression that validates if ex != null is that sometimes Automate doesn't execute the script. It is weird but it happens sometimes. So this ensures that the script is actually executed.
Reviews and ratings can be submitted in the app.