Sub-locations for all script hooks (HOOKS)(PLUGINS)

Version 1.60.0

Feature
Finished

Previously all hooks needed to live in: /usr/local/directadmin/scripts/custom/*.sh for various hooks, like user_create_post.sh or email_pass_change_pre.sh, etc. This feature allows (and we now recommend) using a per-hook folder name, instead of a script name. Let's use the user_create_post.sh as an example. The script at the old location is still valid: /usr/local/directadmin/scripts/custom/user_create_post.sh ----- HOOK NAME FOLDER 1) However, if you're not a human and using an automated installer, say your program is called foo, the recommend path for your copy is now going to be at: /usr/local/directadmin/scripts/custom/user_create_post/foo.sh Where the script filename is taken from the original path, the .sh is dropped, creating a new folder name. All scripts that reside in this "user_create_post" folder, regardless what they're called, will be run. ----- PLUGIN HOOK FOLDER 2) Additionally, plugins can now provide their own hooks, in their existing path: /usr/local/directadmin/plugins/foo/hooks/user_create_post.sh where the full .sh script should be used. ===================== FUNCTIONALITY The passed variables will remain the same as before, for all scripts, with the exception that, should any script run before this script have generated a "result" (exit 0) or "error" (exit 1), those strings would be passed via ENV, but you'd basically just ignore them regardless. If 2 scripts both throw errors/results, their outputs will be appended, so no output should be lost. All scripts will be run, even if one returned a non-zero result. If any one script returns an error, then the entire set of hooks will be an error (eg: user_create_pre.sh would abort if any of them return non-zero) The order of execution would be: 1) scripts/cusotm/hook_name/*.sh 2) scripts/hook_name.sh 3) plugins/*/hooks/hook_name.sh ---- Compile time: Jan 14 2020 at ~18:11:58

Try DirectAdmin with a 30-day money back guarantee!