Last active
August 29, 2015 14:15
-
-
Save greenweb/7f4299ff83b6cab5e9c1 to your computer and use it in GitHub Desktop.
Bash Script to Download latest WordPress and unzip
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
# Download latest WordPress and uncompress | |
cd ~ | |
#mkdir -p /path/to/your/potentially/existing/folder | |
wget http://wordpress.org/latest.tar.gz | |
tar zxf latest.tar.gz | |
mv wordpress/* ./ | |
# Grab our Salt Keys | |
wget -O /tmp/wp.keys https://api.wordpress.org/secret-key/1.1/salt/ | |
# Butcher our wp-config.php file | |
sed -e "s/localhost/"$mysqlhost"/" -e "s/database_name_here/"$mysqldb"/" -e "s/username_here/"$mysqluser"/" -e "s/password_here/"$mysqlpass"/" wp-config-sample.php > wp-config.php | |
sed -i '/#@-/r /tmp/wp.keys' wp-config.php | |
sed -i "/#@+/,/#@-/d" wp-config.php | |
# Run our install ... | |
curl -d "weblog_title=$wptitle&user_name=$wpuser&admin_password=$wppass&admin_password2=$wppass&admin_email=$wpemail" http://$siteurl/wp-admin/install.php?step=2 | |
# Tidy up | |
rmdir wordpress | |
rm latest.tar.gz | |
rm /tmp/wp.keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment