This file contains 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 | |
# Installation: | |
## Download the script to your home directory | |
# Make sure it has execute permissions (`chmod +x wp-install-core.sh`). | |
# Install the script in one of the folders in your PATH. (`mv wp-install-core /usr/local/bin/wp-install-core-sub-dir`) | |
#Usage: | |
# $ mkdir mysite | |
# $ cd mysite | |
# $ wp-install-core {db_name} {db_user} {db_pass} {site_url} "{site_title}" {admin_user} {admin_pass} {admin_email} | |
DB_NAME=${1-'wordpress'} | |
DB_USER=${2-'root'} | |
DB_PASS=${3-'password'} | |
SITE_URL=${4-'https://wordpress.test'} | |
SITE_TITLE=${5-'WordPress Site'} | |
SITE_USER=${6-'admin'} | |
SITE_PASS=${7-'password'} | |
SITE_EMAIL=${8-'your@email.com'} | |
# download WordPress files | |
wp core download | |
# create the wp-config.php file | |
wp config create --dbname=$DB_NAME --dbuser=$DB_USER --dbpass=$DB_PASS | |
# create the database | |
wp db create | |
# install WordPress (less than 5 mins) | |
wp core install --url=$SITE_URL --title="$SITE_TITLE" --admin_user=$SITE_USER --admin_password=$SITE_PASS --admin_email=$SITE_EMAIL | |
echo 'Install finished!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment