DirectAdmin allows to run custom scripts before and after a certain action performed by the control panel. So called hooks, or hookable events are custom PRE and POST action scripts. If a script doesn't exist, it won't be run. If it exists, it will be executed by DA with superuser permissions.
The hook-scripts allow server administrators to add customized scripts for various tasks such as creating/removing Users and Domains. It'is possible to use any scripting language within hooks as well as to call compiled binaries.
DirectAdmin passes environmental variables to the scripts, which can be used for any purposes. Though they won't be passed back even if you change them.
All hooks, i.e. custom scripts should be placed under /usr/local/directadmin/scripts/custom/. The folder is empty by default, so you will need to create desired scripts first, then set correct permissions, and populate them with a needed content.
These hooks to be executed before an action in Directadmin. The control panel will check what a script returns, a non-zero exit code will terminate the main action. An error will be reported.
These are hooks to be executed by DirectAdmin after a certain action is completed. The control panel might check the exit-code as well and roll-back performed action on a non-zero exit-code. So be careful.
The list is actualized as of the DirectAdmin Version: v.1.56.4.