Skip to content

Instantly share code, notes, and snippets.

@dbrosy
Created June 11, 2017 07:22
Show Gist options
  • Save dbrosy/68647eb84745f46f4fd3ae840ea6772a to your computer and use it in GitHub Desktop.
Save dbrosy/68647eb84745f46f4fd3ae840ea6772a to your computer and use it in GitHub Desktop.
#!/bin/bash
# command line arguments
for i in "$@"
do
# echo $i
case $i in
-l=*|--wp_locale=*)
WP_LOCALE="${i#*=}"
;;
-u=*|--wp_url=*)
WP_URL="${i#*=}"
;;
-t=*|--wp_title=*)
WP_TITLE="${i#*=}"
;;
-a=*|--wp_admin_user=*)
WP_ADMIN_USER="${i#*=}"
;;
-p=*|--wp_admin_password=*)
WP_ADMIN_PASSWORD="${i#*=}"
;;
-e=*|--wp_admin_email=*)
WP_ADMIN_EMAIL="${i#*=}"
;;
--default)
DEFAULT=YES
;;
*)
# unknown option
;;
esac
done
## WordPress
# Default variables
WP_INSTALL_PATH="/var/www/html"
# Install WordPress and create the wp-config.php file...
wp core download --path="$WP_INSTALL_PATH" --locale="$WP_LOCALE" --force
# wp core config --path=$INSTALL_PATH --dbname=$PROJECT_SLUG --dbuser=$PROJECT_SLUG --dbpass=$PROJECT_SLUG --dbhost=$DB_HOST --dbprefix=$PROJECT_PREFIX"_"
wp core install --path="$WP_INSTALL_PATH" --title="$WP_TITLE" --url="$WP_URL" --admin_user="$WP_ADMIN_USER" --admin_password="$WP_ADMIN_PASSWORD" --admin_$
# Update WordPress options
# Install and activate defaults plugins
wp plugin install jetpack woocommerce --activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment