Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel plugin bash

Discussion in 'cPanel Developers' started by Havri, Dec 15, 2017.

  1. Havri

    Havri Well-Known Member

    Joined:
    Oct 28, 2013
    Messages:
    81
    Likes Received:
    17
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    I am trying to make a cPanel plugin that our users can use to run some specific bash commands. For now, I managed to create the cPanel plugin from WHM -> cPanel Plugin File Generator and managed to install it in cPanel. What i cannot do is run bash commands from within the cPanel plugin. I have a file named "bash_cpanel.sh" that only does some basic bash commands (for testing purposes):

    Code:
    [root@mycpanelserver my_plugin]# cat bash_cpanel.sh
    #!/bin/bash
    
    
    ## Only for testing purposes
    
    pwd ; ls -al / ;
    
    Screenshot_2017-12-15_14-18-45.png

    It only displays the code from within the bash script and does not run anything. Is there something that needs to be done to run a bash script from within a custom cPanel plugin?

    Thank you.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,897
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    It looks like you only created a plugin interface. You'd need to create the actual cPanel plugin using the instructions at:

    Guide to cPanel Plugins - Software Development Kit - cPanel Documentation

    Ensure to go through each specific step and the corresponding documentation links within the above document (you will see examples of how to include a custom PHP or Perl script).

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice