Ability to pass custom variables to pre/post.sh scripts from GET/POST

Version 1.49


There are many pre/post.sh scripts in DA, used as hooks for almost any action. However, sometimes, you might want to give some custom variable to these scripts via GET or POST, without having to fight with the custom package items or other convoluted means. The solution to this is to use an set of prefixed variables, that are exclusive to the scripts. New directadmin.conf value: hook_custom_vars=0 Internal default value is 0, which is disabled. To enable the feature, add it to your directadmin.conf, and set it to 1. You can use any GET/POST variable name you want from these characters: a-zA-Z0-9_- underscores and dashes are allowed. No spaces. but it must start with the prefix: custom_var_ So, a sample variable, passed with GET or POST might be: custom_var_do_something=yes which would let you access: $custom_var_do_something in any hook script that is called with that request. Note the maxium length of an environmental value is 125749 bytes. Anything greater to or equal to that length will be ignored, and it's env variable will be unset if it was present already.

Interested to try DirectAdmin? Get a 30-day Free Trial!