Execute Custom Commands through the API

Not entirely sure if this belongs in Virtualmin, but since that is where the CLI api is (https://www.virtualmin.com/documentation/developer/cli).

What I’m looking for is a way to execute Custom Commands that are defined in Webmin through the remote API. I don’t think this is possible yet, would this be up for consideration?

Hi,

I don’t think we have it implemented yet, right @Jamie?

How about this -

cd /usr/share/webmin/custom && \
WEBMIN_CONFIG="/etc/webmin" ; export WEBMIN_CONFIG ; \ 
FOREIGN_ROOT_DIRECTORY="/usr/share/webmin/custom" ; export FOREIGN_ROOT_DIRECTORY ;\
FOREIGN_MODULE_NAME="custom" ; export FOREIGN_MODULE_NAME ;\
REMOTE_USER="root" ; export REMOTE_USER=root;\
QUERY_STRING="id=1598627007" ./run.cgi

… paste it to the console and hit enter in the end… you could add this to your own Bash script or create proper Perl script.

Yeah, there’s no API for running custom commands yet.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.