I’d like to use the “Command to run after making changes to a server” to call a script which will create a Datasource for Coldfusion, or update it when i change passwords etc.
I assumed that i would be able to use the same substitutions that are available in the email templates, but this doesn’t seem to work. I’m using the following command
Ok, another hour of hunting around and i’ve solved this. Firstly VM GPL has no help docs attached to the “Command to run after making changes” field, but i noticed that the Pro version does.
The docs for VM Pro say that theres lots of environment variables available, these aren’t substitutions in the same form as the templates ${DOM} but shell enviroment variables like $VIRTUALSERVER_DOM.
A good way to see all variables available when you update a domain is to enter the following in the before or after changes field
[code:1]/usr/bin/env > /root/env.txt[/code:1]
This will list every environment variable available to you when VM calls your script, like
The other problem i had was that the url i was passing to wget needed quotes around it because the &'s were borking the command after the first query argument and making it run in the background.
Ok, another hour of hunting around and i’ve solved this. Firstly VM GPL has no help docs attached to the “Command to run after making changes” field, but i noticed that the Pro version does.
The docs for VM Pro say that theres lots of environment variables available, these aren’t substitutions in the same form as the templates ${DOM} but shell enviroment variables like $VIRTUALSERVER_DOM.
A good way to see all variables available when you update a domain is to enter the following in the before or after changes field
[code:1]/usr/bin/env > /root/env.txt[/code:1]
This will list every environment variable available to you when VM calls your script, like
The other problem i had was that the url i was passing to wget needed quotes around it because the &'s were borking the command after the first query argument and making it run in the background.