We need cPanel actions streamlined. This should be done with simple shell script or via PHP and cPanel SDK. Functionality would we as follows:
- user inputs certain string that will be used later in the proces. Let's say variable $addon.
- in the script itself there is a config for main domain, let's say this is $domain
- in the script itself there is a config for domain that is used later to park domain, let's say this is $domain_main
- in the script itself there is a config for which cPanel user is the one we are performing actions, so this is $user
After we enter $prefix following actions should be performed:
- park a domain on top of $domain for $user
- create new database for $user using $addon as suffix
- create new database user for $user
- assign new database user with new database (all privileges)
- import predefined sql dump into new database
- create folder in public_html of $user account with name: $addon.$domain_main
- create txt file from existing template (example should be provided by you) and place it inside newly created folder
- write new database name, new database username and password to created file
We prefer shell script or any other script that can be run from command line as oposite to PHP but this will also be considered.
Code should be commented and we should be able to easily add additional actions in future on our own.