Best way to run a bash script using the UI/module in virtualmin

I have bash script on our server which copies a base Wordpress system we have from another server and creates new virtual server for it, and changes config settings in the wp-config.php file to make the copy live on the new server domain. Takes about 5 mins, its a fantastic and quick for us to create new websites from our base system.

But it needs SSH access to run it from the command line, and SFTP access to change settings in the file (e.g. enter the domain name).

What would be the best way to have this as a module in Virtualmin or Webmin? Ideally we need a form to enter the domain name, alias domain name, username, database name and password, and then it passes this to our bash script to run it and create the site. This way my developers who are not familiar with SSH can easily run it without accessing the command line.

Thanks!

hi, I run several scripts aka this.sh via cron - once a day, week or month. you can specify in your script.sh how to connect to ssh (sftp) then tell script what it needs to do and once done - with success - exit or with fail to email you. Test script locally on your local machine (I assume you using linux) with some dummy data aka in terminal. then upload this script to your domains user /home and in cron job specify how often you would like to run this script under which user. its very well easy to configure something like this.