Skip to content

Instantly share code, notes, and snippets.

@rojenzaman
Created July 9, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rojenzaman/1739514a934c2765750b0cd52802c891 to your computer and use it in GitHub Desktop.
Save rojenzaman/1739514a934c2765750b0cd52802c891 to your computer and use it in GitHub Desktop.
Install WordPress from command line.
#!/bin/bash -ex
if [ "$#" -lt 2 ]; then
echo "`basename $0` <site> <wp.zip>";
exit 1;
fi
SITE=$1
WPZIP=$PWD/$2
cd /var/www/$SITE/public_html
if [ "$(ls -A .|wc -l)" -ne "0" ]; then
echo "Not Empty: $PWD"
exit 1
fi
tar xzf $WPZIP --strip-components=1
mkdir wp-content/uploads
mkdir wp-content/upgrade
chown -R $SITE:www-$SITE *
chmod -R g+w *
echo "go to $SITE and install"
echo "then run post-install-wp"
@rojenzaman
Copy link
Author

Usage

install-wp.sh <site> <wp.zip>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment