jimlongo

Well-Known Member
Mar 20, 2008
289
24
68
given that I've been developing for a while this module, and there are hooks that are no longer relevant and weren't removed properly at the time, I'd like to clean up the hooks registry manually.

Given that I have this
Code:
[[email protected] ~]# /usr/local/cpanel/bin/manage_hooks list
Whostmgr:
    Accounts::change_package:
        id: Gu0sr_inAsLJuErsvlZh8HFi
        exectype: script
        weight: 100
        hook: /usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php --changePackage
        stage: post
        escalateprivs: 0
        --
How would I remove that? I keep getting this error
Code:
[[email protected] ~]# /usr/local/cpanel/bin/manage_hooks delete --manual hook /usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php  --category Whostmgr --event 'Accounts::change_package' --stage post
No matching hooks found

Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello @jimlongo,

Here's the command you'd use:

Code:
/usr/local/cpanel/bin/manage_hooks delete script /usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php --manual --category Whostmgr --event 'Accounts::change_package' --stage post
Let me know if that helps.

Thank you.
 

jimlongo

Well-Known Member
Mar 20, 2008
289
24
68
Thanks Michael, but I still get the same result.
No matching hooks found
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello @jimlongo,

It looks like the command in the hook you are attempting to delete uses a flag, so you'd need to use a command like this to delete it:

Code:
/usr/local/cpanel/bin/manage_hooks delete script "/usr/local/cpanel/whostmgr/docroot/cgi/MyApp/Model/Hook/hooks.php --changePackage" --manual --category Whostmgr --event 'Accounts::change_package' --stage post
Thank you.
 
  • Like
Reactions: jimlongo