US: 1-941-4621-069
  
Cyprus: 3-572-2052-781

Go Back   ISPsystem.com Forums > Modifications / Add-ons > Scripting / API


Reply
 
Thread Tools
Old 04-26-2010, 08:37 PM   #1
Junior Member
 
Join Date: Apr 2010
Posts: 4
mentaldirector is on a distinguished road
Question Automated site creation

Hi,

I want to create a shell script, which will create www domain, database and user, and copy some standard scripts below www directory.

Do you have such a sample?

I wasn't able to find domain / db creation in the API.

Thank you for this great software...
mentaldirector is offline   Reply With Quote
Old 04-26-2010, 11:21 PM   #2
Junior Member
 
Join Date: Apr 2010
Posts: 4
mentaldirector is on a distinguished road
Default

Ok, I've found the answer

/usr/local/ispmgr/sbin/mgrctl wwwdomain.edit domain=test.com alias=www.test.com

owner=username php=phpmod sok=yes ip=x.x.x.x admin=test@test.com

charset=utf8 cgi=on autosubdomain=asdnone

mentaldirector is offline   Reply With Quote
Old 04-27-2010, 01:09 AM   #3
Junior Member
 
Join Date: Apr 2010
Posts: 4
mentaldirector is on a distinguished road
Default

Now I need to run it in a PHP script.

I'm trying exe command with php but there is no response. Do you have an idea?
mentaldirector is offline   Reply With Quote
Old 04-27-2010, 11:24 PM   #4
ISPsystem team
 
slava's Avatar
 
Join Date: May 2008
Location: ISPsystem
Posts: 588
slava is on a distinguished road
Default

Try run as
Code:
/usr/bin/php-cgi -q script.php
or add to firstl line of script
Code:
#!/usr/bin/php-cgi -q
and run as
Code:
./script.php
slava is offline   Reply With Quote
Old 04-27-2010, 11:56 PM   #5
Junior Member
 
Join Date: Apr 2010
Posts: 4
mentaldirector is on a distinguished road
Default

Thank you but I'm not trying to run phpscript in the shell.

I'm trying to run shell script in php script (with exec/system/passthru etc). I think there is a permission problem. For example I can run whoami and see which user executes php scripts. Then I've added that user to operator group to enable letting it run shell scripts. But it didn't work.

By the way, my VPS is in JoinVPS and it's prebundled with FreeBSD 8.0 + ISP Manager. Actually it's working perfect, really. Better than any control panel app. Congratulations in deed.
mentaldirector is offline   Reply With Quote
Reply

Tags
automation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:20 PM.