sime

Active Member
Oct 16, 2005
35
0
156
Hi

My goal is to execute a script in cpanel, as the same user who is logged into cpanel. I believe this is one of the simplest use-cases.

I've been following these pages to create an addon
http://www.cpanel.net/docs/modules/cPanel_Modules.htm
http://www.cpanel.net/docs/cpaddons/

I think I can create the .pm file ok, and this gives me functions I can call from html. But what and where to put a html file? I can't find that information anywhere.

I'd like to download a simple foo.tgz which contains the total solution with install instructions. This should get me further.

Any tips appreciated.
 

sime

Active Member
Oct 16, 2005
35
0
156
cPanel 11
Better but on my ice-skates and butt-guard.

OK. What's the difference b/t a plugin and an addon I wonder...
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
cPanel 11
Better but on my ice-skates and butt-guard.

OK. What's the difference b/t a plugin and an addon I wonder...
I admit, this can get very confusing very fast.

An addon script ("addon") is the old (deprecated as of version 11) version of what is now known as a WHM Plugin (version 11).

They're now called Plugins to avoid confusion with cPAddons (which are completely different from Addons).
 

sime

Active Member
Oct 16, 2005
35
0
156
Yes, "plugin" is a better label by far.

Well, AFAICT, I'm trying to do something like this:
<?cp system '/scripts/test/test.sh'; ?>'

I'm hoping that 1) the above can run as the logged in user and 2) it doesn't require the logged in user to have any normal shell access.

Any help appreciated. FYI, I've tried testexec.pm, but loading it is really eluding me. I look at something like doadddomain.html and I can't see how it loads the required .pm files -- at least my html file isn't greatly different...