You can use hooks in SolusVM 2 to automatically run custom scripts before or after specific events take place. Hooks should be set under this directory: /usr/local/solus/hooks/, they can be written using Bash, PHP, Python or else.
Basically what it does is whenever there is an event it sends in stdin a json snap with the event and the action (e.g.: new installation, os reinstall, restart, etc) to all files under the hooks’ folder.
Example of JSON code:
{
"action": "server-restart",
"stage": "pre",
"data": {
"uuid": "915b5ca2-ff02-45ab-ba73-2e90793e6819",
"virtualization_type": "vz"
}
}