ispCP - Board - Support
[HOWTO] Using the CLI to manage ispcp via command line (scripts) - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [HOWTO] Using the CLI to manage ispcp via command line (scripts) (/thread-4255.html)

Pages: 1 2 3 4 5 6 7


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 03-17-2010 06:56 PM

(03-17-2010 09:40 AM)rethus Wrote:  I have found a little bug into your scripts. Not an prgramming-bug... its an logical BUG.
I have installed ispCP and configured it to only set hosting-plans on Admin - not on Reseller.
Why would you want this? If you company grows up, then you will have some non-technical person to be your resseller to do burocracy stuff, while you are the admin user for the technical stuff.
Also this is the way it worked in plesk one the days I was using it (8.2.smtng)
Quote:If i use your Script, i have to add --created_by and --hosting_plan. And its only works, if the Hosting_Plan was created by the user who is named on --created_by.

But this is no logical assignment. Cause if i add all my plesk-customers i had to add them to the admin (cause reseller don't have own hosting_plans.

But ispCP don't can assign users from (or to) admin. This is also a logical misstake of ispCP, cause a user have to be also assignable from reseller back to admin... or from admin to reseller....

I solve my Problem with changing your domain.php...

Change this line:
Code:
$result = $mysqli->query("SELECT `props` FROM `hosting_plans` WHERE `name`='$hosting_plan' AND `reseller_id`='$created_by'");

into:

Code:
$result = $mysqli->query("SELECT `props` FROM `hosting_plans` WHERE `name`='$hosting_plan'");

Quote:So my next Question is... how did you set all the User-Details (adress, name and so on)?
I see some variables into your script, but seems they doesn't accessaible from outside?
These are not mandatory, so I just left them empty so I had a more general script. If you want to add them It's ok fine for me, I'll gladly accept the patches.

A couple of important things:
.- I forgot to add the getopts.php (it's just a code snippet so you can use longopts in php-cli) taken from the php example codes. Please redownload the code and check again. (there's also some new stuff like htaccess creation)
.- You CAN add hosting plans to the reseller, I am doing it normally with a SQL query like this:
INSERT INTO `hosting_plans` VALUES ('',RESELLER_ID,'Personal','_no_;_no_;0;-1;5;1;-1;-1;2048;200;_no_;_no_','Hosting plan','0.00','0.00','','',0);
where RESELLER_ID is the reseller id. Also you can switch to the reseller and create the plans from there.


NOTE: I'd like to know what is the layout of your users, everyone has it's own reseller?
I just updated the page on http://www.isp-control.net/documentation/doku.php?id=dev:daemon_commands_cli with the latest updates of the CLI scripts.
Now there's also a complete example to create a working domain.


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - rethus - 03-26-2010 04:48 PM




RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 03-31-2010 06:08 PM

There's a new release of the scripts:
.- Until now you could only use the hosting plans from the reseller, and some people complained because they where setting the plans as admin.
Now there's the variable plan_owner (defaults to reseller) that can be changed to admin, and that will allow you to use the admin plans.

//Are the hosting plans owned by admin or reseller?
$plan_owner = "reseller";


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 04-13-2010 06:51 PM

Just uploaded a new version of the scripts, the changes:
.- Ftp creation should work fine with 1.0.4 (at some point it had broke)
.- You can specify the username for ftp with --user


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - rethus - 05-14-2010 11:08 PM

Hi aseques,

now my bash-script which automigrate from plesk to ispCP is nearly finished.
On My Plesk i have a qmail (imap-account with subfolders). I have rsync it to ispCp and run the Webmailer. but the Webmailer show only the Inbox, not all the other subfolders.

I fix it, by clicking on "Folders" (on upper navigationbar) and choose all Folders to subscribe.

But my question: Did u know a CLI-Command to subscribe all Folders by default?


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 05-14-2010 11:22 PM

(05-14-2010 11:08 PM)rethus Wrote:  Hi aseques,

now my bash-script which automigrate from plesk to ispCP is nearly finished.
On My Plesk i have a qmail (imap-account with subfolders). I have rsync it to ispCp and run the Webmailer. but the Webmailer show only the Inbox, not all the other subfolders.

I fix it, by clicking on "Folders" (on upper navigationbar) and choose all Folders to subscribe.

But my question: Did u know a CLI-Command to subscribe all Folders by default?

I thing that plesk is using courier, also the default ispcp package, so If you are migrating the subscribe file, it should be seamless.
If you are using dovecot, then there's the courier_migrate tool tha will keep the important information for you (seen flags and subscription)


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 05-15-2010 12:37 AM

After testing the scripts with 1.0.5, I've released the last version. This are the main changes:

.- More checks to avoid errors and better presentation
.- Fixed the subodmain creation for domain alias
.- Dropped the enable_mail/disable_mail, it was a ugly hack and it has to be solved differently


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - dcreation - 05-18-2010 05:40 PM

Thanks alot for your work so far. I think it can be very useful.


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - help40 - 07-31-2010 09:41 AM

what about "disable user" and "enable user" for changing the "Status" of the users ?


RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 08-03-2010 11:52 PM

Hi,

I just released another version, I cannot update the wiki page currently as there seem to be some problems on the wiki, but these are the major changes to scripts.

Two new functions:
.- change_domain_pass: The name is clear enough, give a domain, and the new password you want for that particular domain.
.- set_mail_limit: This allows us to set the mail limit (it could be extended to other variables) to any value we need.
For example, to disable mail for example.com, you can do:
Code:
php domain.php --domain example.com --action set_mail_limit --limit --1 #Note the doble hyphen

(07-31-2010 09:41 AM)help40 Wrote:  what about "disable user" and "enable user" for changing the "Status" of the users ?
I'll have a look to this, it could be interesting too.
I'm thinking on putting the code somewhere where the people can branch the code to make improvements...