Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@rojenzaman rojenzaman commented Jul 9, 2020

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