Command to run after making changes to a server -- creation, alteration, or deletion?

3 posts / 0 new
Last post
#1 Tue, 04/06/2010 - 08:58
hmbl programmer

Command to run after making changes to a server -- creation, alteration, or deletion?

I'm using Virtualmin, and I have a command set up under Virtualmin > Module Config > Actions Upon Server and user creation > Command to run after making changes to a server

This command is designed to perform a few additional steps after the account is set up. However, the action is called every time the account is modified, and also gets called when the account is deleted. The actions it performs should only be done when the account is first created.

How can my custom command know which action is being performed? Is there an environment variable which determines if the action is creation, alteration, or deletion?

Tue, 04/06/2010 - 14:58
JamieCameron

You can check the $VIRTUALSERVER_ACTION environment variable - it will be set to CREATE_DOMAIN only when the virtual server is being created ..

For more docs, see : http://www.virtualmin.com/documentation/id,template_variable_listing

''

Tue, 04/06/2010 - 15:08 (Reply to #2)
hmbl programmer

Awesome, thanks!

Topic locked