Created
October 20, 2018 19:14
-
-
Save joeydi/71676fd3ad3d2408c0618ae3c97a3dfd to your computer and use it in GitHub Desktop.
Download WordPress, Create Database, and Install - Requires WP CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download WordPress, create database, configure, and install | |
if [ $1 ] | |
then | |
echo "Installing in directory $1" | |
mkdir $1 | |
cd $1 | |
mysql -uroot -proot -e "CREATE DATABASE \`$1\` /*\!40100 DEFAULT CHARACTER SET utf8 */;" | |
echo "Website title:" | |
read title | |
wp core download | |
wp core config --dbname=$1 --dbuser=root --dbpass=root --dbhost=127.0.0.1 | |
wp core install --url=$1.localhost --title="$title" --admin_user=admin [email protected] | |
else | |
echo Specify directory to install into! | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment