Skip to content

Instantly share code, notes, and snippets.

@Twanneman
Forked from lucprincen/New WP Install
Last active April 26, 2018 20:08
Show Gist options
  • Save Twanneman/b44c604b900e9675547a to your computer and use it in GitHub Desktop.
Save Twanneman/b44c604b900e9675547a to your computer and use it in GitHub Desktop.
#!/bin/sh
cd [YOUR-INSTALL-DIR]
wget http://wordpress.org/latest.tar.gz
tar -zvxf latest.tar.gz
printf "What's the name of the install? "
read NEWDIR
mv -f wordpress $NEWDIR
cd $NEWDIR
cd wp-content
mkdir upgrade
mkdir uploads
chmod -R g+rwx upgrade
chmod -R g+rwx plugins
chmod -R g+rwx uploads
cd ../../
rm -f -r latest.tar.gz
chgrp -Rv apache $NEWDIR
cd $NEWDIR
echo 'creating the config file...'
wp core config --dbname=[db-name] --dbuser=[db-user] --dbpass=[db-pass] --dbprefix=[db-prefix]
wpurl=[site_url]'$NEWDIR
wpadminname=[admin_name]
wpadminmail=[admin_email]
wpadminpassword=[admin_pass]
printf "What is the website name? "
read WPNAME
wp core install --url=$wpurl --title=$WPNAME --admin_name=$wpadminname --admin_email=$wpadminmail --admin_password=$wpadminpassword
wp plugin install wordpress-seo
wp plugin activate wordpress-seo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment