The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running a command from cPanel ?

Discussion in 'cPanel Developers' started by chrismfz, Sep 11, 2009.

  1. chrismfz

    chrismfz Well-Known Member

    Jul 4, 2007
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider
    We run a program (streaming daemon) for a specific user
    which often crashes.

    I've made a script that finds the PID, kills it and then restart
    the specific service.

    Is there a way to put this script as a button/click in
    the specific user's cPanel account ?

    So everytime it crashes / needs reboot the user could restart
    the service (run the script) from inside his cPanel account...
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Nov 29, 2006
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You could create a .cgi script that executes within cPanel. This script would execute as the cPanel user. Place this somewhere within /usr/local/cpanel/base/frontend/x3/.

    You can then use the Plugin Generator on Developer to create an icon for this CGI script; putting the script's path starting with /usr/local/cpanel/base/frontend/x3/ as the access URL. You may want to leave the checkbox for Feature Manager checked.

    Next, install the plugin file using the instructions on the website.

    Now, so this is only available to that 1 user, create a package for that user and assign it to them, with this plugin enabled. Disable this plugin in all other packages and their feature lists. If you do not use feature lists, just uncheck it in the "default" feature list. Do not uncheck this in the disabled feature list, that will prevent this plugin from working for anyone, including your intended customer.

Share This Page