Skip to content

Instantly share code, notes, and snippets.

@joeydi
Created October 20, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeydi/71676fd3ad3d2408c0618ae3c97a3dfd to your computer and use it in GitHub Desktop.
Save joeydi/71676fd3ad3d2408c0618ae3c97a3dfd to your computer and use it in GitHub Desktop.
Download WordPress, Create Database, and Install - Requires WP CLI
#!/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 --admin_email=joeydi@okaypl.us
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