Install Custom Script via Virtualmin API Error

Hi,

I’m new to Forum but i have been using Virtualmin Since many years, i’m a fan of Virtualmin. Amazing Stability and Performance.

Recently i have come with automation concept to be implement using Virtualmin API, I’m able to create domain via API and its working perfectly. I have also added custom script installer via System Settings >> Script Installer but when i’m creating domain via API the script is not getting install can you let us know how i can do that? Upon Domain creation via API, script should install as well.

If it is not possible then i have come up with the API to install script but getting following error

<?php $result = shell_exec("wget -O - --quiet --http-user=root --http-passwd=password --no-check-certificate 'https://ns1.mydomain.com:10000/virtual-server/remote.cgi?program=install-script&type=CustomScript&domain=myanotherdomain.com&db=mysql myanotherdomain&path=/home/myanotherdomain/public_html&user=dbusername&pass=dbpassword'"); echo $result; ?>

Script type CustomScript is not known Installs a third-party script into some virtual server. virtualmin install-script --domain domain.name --type name --version number|“latest” [–unsupported] [–path url-path] [–db “type name”] [–prefix-db] [–opt “name value”] [–upgrade id] [–force-dir directory] [–mongrels number] [–user username --pass password] [–log-only] Exit status: 256

Please help if it can be done via Virtualmin Via admin panel would be great or help me with the API Code.

Thanks in Advance

Regards
Sachin G.

Sorry for the slow reply on this one.

Does your script show up when you run:

# virtualmin list-available-scripts

?

If it is showing up in the UI, but isn’t accessible from the command line and remote API, it would be a bug. But, I think they share code, so I’m guessing something is wrong with the Install Script if it isn’t accessible via the API.

# virtualmin list-available-scripts

Returns the CamelCase name.

type=CustomScript

It appears the API install-script command is case sensitive. Although you are using CamelCase for your script name, the file on disk might be all lowercase. In my case using all lowercase worked.