Last active
August 29, 2015 14:08
-
-
Save webplantmedia/b8914ae18612d932f616 to your computer and use it in GitHub Desktop.
Download and extract WordPress to web server
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 | |
# set -xv | |
# by Chris Baldelomar | |
# | |
# Instructions | |
# > cd /web/server/path/public_html | |
# > curl -O {Gist URL} && chmod +x wordpress-installer.sh && ./wordpress-installer.sh | |
# DONE | |
src="https://wordpress.org/latest.zip" | |
install=true | |
if [ "$install" = true ] ; then | |
# remove all files but leave folders | |
find . -type f -not -name 'wordpress.sh' -exec rm -f {} \; | |
find . -type d -name 'wp-content' -name 'wp-includes' -name 'wp-admin' -exec rm -f {} \; | |
# remove and known folders | |
if [ -d "wordpress" ]; then | |
rm -r wordpress | |
fi | |
if [ -d "wp-admin" ]; then | |
rm -r wp-admin | |
fi | |
if [ -d "wp-includes" ]; then | |
rm -r wp-includes | |
fi | |
if [ -d "wp-content" ]; then | |
rm -r wp-content | |
fi | |
# download, unzip, and remove zip | |
curl -L -o wordpress-latest.zip $src | |
unzip -qo wordpress-latest.zip | |
rm wordpress-latest.zip | |
# move content into current directory | |
mv wordpress/* . | |
rm -r wordpress | |
# set proper permissions | |
find . -type f -exec chmod 644 {} \; | |
find . -type d -exec chmod 755 {} \; | |
if [ -f "wordpress-installer.sh" ]; then | |
rm wordpress-installer.sh | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment