Last active
October 7, 2015 11:27
-
-
Save mxmilkiib/3157720 to your computer and use it in GitHub Desktop.
WP Base Install scratchpad old
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 | |
# this is a work in progress! NOT for production. | |
# requires wp-cli | |
# usage: wp-base-install | |
# or: ./wp-base-install.sh | |
# Bits of inspiration from https://gist.github.com/2853221 | |
# to look at: http://www.servercobra.com/automated-wordpress-install-with-nginx-script/ | |
# Download WordPress | |
echo "Project name (lowercase):" | |
read -e PROJECT | |
cd /var/www | |
mkdir $PROJECT && cd $_ | |
wp core download | |
# Set up config.php and database | |
mv wp-config-sample.php wp-config.php | |
echo “Database Name: ” | |
read -e DBNAME | |
echo “Database User: ” | |
read -e DBUSER | |
echo “Database Password: ” | |
read -s DBPASS | |
echo “Editing wp-config.php...” | |
sed -i 's/database_name_here/'$DBNAME'/g' ./wp-config.php | |
sed -i 's/username_here/'$DBUSER'/g' ./wp-config.php | |
sed -i 's/password_here/'$DBPASS'/g' ./wp-config.php | |
Q1="CREATE DATABASE IF NOT EXISTS $DBNAME;" | |
Q2="GRANT ALL ON *.* TO '$DBUSER'@'localhost' IDENTIFIED BY '$DBPASS';" | |
Q3="FLUSH PRIVILEGES;" | |
SQL="${Q1}${Q2}${Q3}" | |
MYSQL=`which mysql` | |
$MYSQL -uroot -p -e "$SQL" | |
# Install site | |
echo “Url: ” | |
read -e SITEURL | |
echo “Title: ” | |
read -e SITETITLE | |
echo "E-mail: " | |
read -e SITEMAIL | |
echo “Site Password: ” | |
read -s SITEPASS | |
echo "Install site? (y/n)" | |
read -e SITERUN | |
if [ "$SITERUN" != "y" ] ; then | |
exit | |
else | |
wp core install --url=$SITEURL --title=$SITETITLE --admin_email=$SITEMAIL --admin_password=$SITEPASS | |
# [--admin_name=username] | |
## Install theme | |
cd wp-content/themes && wget https://github.com/eddiemachado/bones/zipball/master && unzip master && mv eddie* $PROJECT && rm master && cd /var/www/$PROJECT | |
wp theme activate bones | |
## Sass support | |
git clone git://github.com/sanchothefat/wp-sass.git wp-content/plugins/wp-sass | |
cd wp-content/plugins/wp-sass && git submodule update --init --recursive && cd /var/www/$PROJECT | |
## Semantic.gs | |
cd wp-content/themes/bones/library/scss | |
wget https://raw.github.com/twigkit/semantic.gs/master/stylesheets/scss/grid.scss -O _grid.scss | |
cd /var/www/$PROJECT | |
# Install plugins | |
wp plugin install backwpup | |
wp plugin install google-analytics-for-wordpress | |
wp plugin install w3-total-cache | |
wp plugin install all-in-one-seo-pack | |
wp plugin install rewrite-rules-inspector | |
wp plugin delete hello-dolly | |
# Server user and group | |
chown www-data * -R | |
chgrp www-data * -R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment