Skip to main content

Custom Anti-Spam plugin planning

Comments

2 comments

  • AndrewH.
    What you can do (and this is what I had originally done when I worked on the x4 installer) is this: Create an install script with Perl From the install script call register_plugin similar to this: sub register_x4_plugin { if ( -x "/usr/local/cpanel/bin/register_cpanelplugin" ) { print "\nRegistering plugin with cPanel...\n"; `/usr/local/cpanel/bin/register_cpanelplugin x4.cpanelplugin`; #Replace this with your .cpanelplugin file } else { print "\nFailed to register plugin with cPanel\n"; } }
    If your plugin registers, copy files over ...and you're done! Now you should also have an uninstall script, since that's the best practice. For that.... Write a Perl script From there call unregister_plugin (make sure to specify your plugin) sub unregister_x4_plugin { if ( -x "/usr/local/cpanel/bin/unregister_cpanelplugin" ) { print "Unregister plugin with cPanel...\n"; `/usr/local/cpanel/bin/unregister_cpanelplugin /var/cpanel/registered_cpanelplugins/x4theme`; } else { print "Failed to unregister plugin with cPanel.\n"; } }
    Remove files as needed ..and that's it! edit: Oh! To install just run from the command line. edit2: Docs link!
    0
  • MACscr
    Where should i be storing my plugin? /usr/local/cpanel/3rdparty/ just doesnt seem right. Also, what method should I use to automatically make my plugin available for all cpanel themes? Important note, I am only using php and a little bash. I don't know perl and won't be using it.
    0

Please sign in to leave a comment.