Tasker to run scripts in terminal shell
This can be easily achieved by using Tasker.

Instructions:


Create a named task.
A1: Code >> Run Shell [Command: (insert any code you wish to run)  Store Output: (insert any variable which will retain the value of ouput - stdout) Store errors in : (insert a variable which stores errors - stderr)]
Tap back to exit
Link your task to your profile.


Note: for shell commands that require root you have to the tick the 'use root' option