From: Jamie C. <jca...@we...> - 2005-01-18 07:38:45
|
On Tue, 2005-01-18 at 10:52, Barry wrote: > Jamie - > > So far virtualmin has been working very well for me. But I am having a > bit of trouble here tha tyou can probably help me out with easily. > > After I set up a new virual domain using virtualmin, I need to do some > additinal configuration. In the module config, I see I can specify a > command to run there. > > I created a shell file (using bash commands), that works fine if I run > it form the command line. My questions are these: > > 1 - assuming the executable script is in /mydir/myscript, what is the > format of the input to put into the module config? You can just enter /mydir/myscript > 2 - assuming I need to pass some parameters - the first is the username > that owns the new domain, and the second is the password for that user, > how do you recommend I add those in? Can I use the same conventions as > for the server templates? All that information comes in as environment variables, whose names start with VIRTUALSERVER_. Some useful ones are : VIRTUALSERVER_DOM : The domain name VIRTUALSERVER_USER : The Unix username VIRTUALSERVER_PASS : The user's password > 3 - I plan to run this all from a perl script via lwp, so I can add this > option , create the domain, and then remove the option easily enough. > But I wonder if it might not be a good idea to have the before/after > scripts show up on the domain creation page (and maybe other places > too)? I think the default on those pages should be whatever the setting > is in the module config, and you should be able to override it. That way > someone can use a script that meets their current need, not every > possible and foreseeable need as it stands now. It is probably better for the script to check some condition or config file to determine what it should do, rather than being turned on and off on a per-domain basis. By the way, if you are trying to create a domain from the command line or from a script, you might want to look at the create-domain.pl script that comes with Virtualmin. It can set up a domain with features and password specified as command-line parameters, and would be far more reliable that using LWP. - Jamie |