Load hooks from directory (/etc/imscp/custom.d/*.pl)

  • Hello all,

    I was in need of a way to automatically include hooks when the engine is executed and I ended up with a very easy modification to achieve this.

    As suggested by Nuxwin in his thread (http://forum.i-mscp.net/Thread…0-rc1-4-and-newer-version) I've made sure that the HooksManager will load all the perl scripts in {CONF_DIR}/custom.d/ at initialization.

    No priorities support thought.

    To apply the patch:

    1. patch /var/www/imscp/engine/PerlLib/iMSCP/HooksManager.pm < HooksManager.pm.diff

    To remove the patch:

    1. patch -R /var/www/imscp/engine/PerlLib/iMSCP/HooksManager.pm < HooksManager.pm.diff

    Use at your own risk.

  • Hello ;

    Thanks you for your patch. I'll surely add it in our development branch ASAP. ;)


  • What is the current state of this, has it been integrated to master?

  • Yes, hooks are loaded from /etc/imscp/hooks.d/*.pl, plus the code is written better.

    Edited once, last by Zero ().