Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### variables ###
- # $1: folder, database, url, page-title
- # $2: mysql user
- # $3: mysql password
- # $4: admin_name
- # $5: admin_email
- # create directory
- mkdir $1 && cd $1
- # link valet
- valet link
- # restart valet
- valet restart
- # create database
- echo "Please enter your MYSQL Password:"
- echo "create database $1" | mysql -u root -p
- echo "✓ Database created."
- # get latest wordpress
- wp core download;
- echo "✓ Wordpress Core downloaded."
- # TODO: Edit wp-config.php
- db_name="database_name_here"
- db_name_new=$1
- db_user="username_here"
- db_user_new=$2
- db_pw="password_here"
- db_pw_new=$3
- FILE="wp-config-sample.php"
- sed -i '' -e 's/'$db_name'/'$db_name_new'/g' wp-config-sample.php
- sed -i '' -e 's/'$db_user'/'$db_user_new'/g' wp-config-sample.php
- sed -i '' -e 's/'$db_pw'/'$db_pw_new'/g' wp-config-sample.php
- # Rename wp-config
- mv wp-config-sample.php wp-config.php;
- # install wordpress
- wp core install --url=$1.test --title=$1 --admin_user=$4 --admin_email=$5
- echo "✓ Wordpress Installation."
- # remove unnecessary plugins
- wp plugin delete hello akismet
- echo "✓ Deleted plugins."
- # install standard plugins
- wp plugin install custom-post-type-ui
- wp plugin activate custom-post-type-ui
- wp plugin install advanced-custom-fields
- wp plugin activate advanced-custom-fields
- echo "✓ Installed & activated plugins."
- echo "✓ All fine."
Add Comment
Please, Sign In to add comment