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-15453.html)



[HOWTO] Using the CLI to manage ispcp via command line (scripts) - aseques - 10-28-2011 08:51 PM

I wanted to create create a set of tools to be able to create/modify/delete domains from the command line.
This approach is really practical when doing migrations from other control panels, for example, with the list of domains+passwords, you'd be able to replicate the system in a few minutes.
There is some documentation about usage at the dokuwiki here.
For any suggestions, modifications of the code,etc .. post it here or edit the wiki, so it can be useful for us all

Contributing code
If you want to test and improve the most current code, you can connect to:
http://bitbucket.org/aseques/ispcp-cli/src

UPDATE
Fixed alias creation
Added mail password change option
Change default for dns creation to protected=no

See CHANGELOG to view the full list of changes

It's designed to work at least with the current 1.0.7 (there are older working versions too)
You can call it something like:
php domain.php --action create_domain --created_by "reseller" --domain "example.com" --password "password25" --hosting_plan "FullPlan"
To create the hosting for the domain example.com using the template FullPlan and with the admin password password25, note that when creating a domain, the name of the admin and the domain will be the same (due to the script limitations)
or
php domain.php --action create_ftp --created_by "reseller" --domain "example.com" --password "password25" --hosting_plan "FullPlan" --user "username"
To create the ftp account username@example.com for the previous domain.

To check the usual syntax of many of the commands, you can user the verify_cli.sh that will create a sample domain with most of the features..

It has been extensively tested, and it shouldn't break anything.
For anyone interested in using the script, I'm not a programmer so the code probably will hurt your eyes, any advice will be taken into consideration.
I hope it will be of use to you.

UPDATE: The admins closed the original post, the only valid source for 1.0.7 versions is the one in this post
The version for 1.0.7 and current trunk [attachment=1738]