So far (detailed in this thread: Command to run after making changes to a server) I have this working reasonably for the same thing (in case anyone else needs it some time):
[ "$VIRTUALSERVER_ACTION" = "CREATE_DOMAIN" ] && virtualmin create-database --domain "$VIRTUALSERVER_DOM" --name "${VIRTUALSERVER_DB}_roundcube" --type mysql && virtualmin install-script --domain "$VIRTUALSERVER_DOM" --type roundcube --version 1.6.10 --path / --db mysql "${VIRTUALSERVER_DB}_roundcube"
When entered into:
System Settings -> Virtualmin Configuration -> Actions upon server and user creation -> Command to run after making changes to a server
It ends in an error/non-error… it knows that it didn’t error, because it says nothing about running anything at all if you leave “Only on failure
” checked on “Always show output from pre and post commands
” just below the command:
but if you check “Yes” there instead:
It says it failed somehow, but the database is created and Roundcube stuff is in it, etc. (It looks similar running from the command line, big blank below the “failed” line, detailed in the thread I linked above.)
Anyway this will work for me for now at least, though I’m sure the built-in one has some sanity checks and such which this does not.
(Also the “–path /” I have just installs Roundcube into the root. Obviously you might want to adjust that.)