I’ve got a task for a customer I need to carry out, and I’m trying to automate the creation of a wordpress blog. I can write a bash script to wget the latest version and extract it, I can even modify the config file with database options etc, but I can’t work out how to install and activate plugins, themes and fill out details such as the name, blog name etc.
Has anyone got any tips / hints, has anyone ever done this before and is a bash script the best way to go about it?
Tom
You need four steps in your script:
* wget the word-press archive and decompress it into a folder
* Create the database, username, password and assign user to the database in mysql
* Import the SQL script from the decompressed archive
* Add the title of the blog and its URL to the wp_options table
* Add admin username and the admin password to the wp-users table. Remember that you have to encrypt the password before adding it.
All of these steps are already done in the Fantastico script that is offered with any cPanel account (WHM).