Created
July 9, 2020 17:17
-
-
Save rojenzaman/1739514a934c2765750b0cd52802c891 to your computer and use it in GitHub Desktop.
Install WordPress from command line.
This file contains 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 -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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
install-wp.sh <site> <wp.zip>