Update antipode-wp-install.sh
This commit is contained in:
parent
717cdf177c
commit
c6348352a2
@ -13,10 +13,22 @@ read -p "Database User: " dbuser
|
|||||||
read -sp "Database Password: " dbpass
|
read -sp "Database Password: " dbpass
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
# Starting the Wordpress installation process
|
# Starting the Wordpress installation process
|
||||||
clear
|
clear
|
||||||
|
echo "==================================="
|
||||||
|
echo "Choose Wordpress installation mode:"
|
||||||
|
echo "==================================="
|
||||||
|
echo
|
||||||
|
echo "1. Install Wordpress using wp-cli"
|
||||||
|
echo "2. Install Wordpress without wp-cli"
|
||||||
|
echo
|
||||||
|
read -p "Choose install method: " install_method
|
||||||
|
|
||||||
# # Starting the Wordpress installation process using wp-cli
|
if [ "$install_method" == 1 ]; then
|
||||||
|
|
||||||
|
# Starting the Wordpress installation process using wp-cli
|
||||||
# echo "==================================="
|
# echo "==================================="
|
||||||
# echo "Please wait while we install wp-cli"
|
# echo "Please wait while we install wp-cli"
|
||||||
# echo "==================================="
|
# echo "==================================="
|
||||||
@ -27,20 +39,21 @@ clear
|
|||||||
# echo "=========================="
|
# echo "=========================="
|
||||||
# echo "Finished installing wp-cli"
|
# echo "Finished installing wp-cli"
|
||||||
# echo "=========================="
|
# echo "=========================="
|
||||||
# echo
|
|
||||||
# read -p "Install wordpress in a new directory (y/n): " new
|
echo
|
||||||
#
|
read -p "Install wordpress in a new directory (y/n): " new
|
||||||
# if [ "$new" == y ] ; then
|
|
||||||
# read -p "Name of the wordpress directory: " dir_name
|
if [ "$new" == y ] ; then
|
||||||
# mkdir -p $dir_name
|
read -p "Name of the wordpress directory: " dir_name
|
||||||
# cd $dir_name
|
mkdir -p $dir_name
|
||||||
# fi
|
cd $dir_name
|
||||||
|
fi
|
||||||
|
|
||||||
# Download the latest wordpress package using wp-cli
|
# Download the latest wordpress package using wp-cli
|
||||||
wp core download
|
wp core download
|
||||||
# Creating wp-config file using credentials defined on lines 8-11
|
# Creating wp-config file using credentials defined on lines 8-11
|
||||||
wp core config --dbhost=$dbhost --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass
|
wp core config --dbhost=$dbhost --dbname=$dbname --dbuser=$dbuser --dbpass=$dbpass
|
||||||
chmod 640 wp-config.php
|
chmod 644 wp-config.php
|
||||||
|
|
||||||
# Entering details of the new Wordpress site
|
# Entering details of the new Wordpress site
|
||||||
clear
|
clear
|
||||||
@ -66,7 +79,48 @@ clear
|
|||||||
# Installing Wordpress site using credentials defined on lines 71-76
|
# Installing Wordpress site using credentials defined on lines 71-76
|
||||||
wp core install --url=$url --title="$title" --admin_name=$admin_name --admin_password=$admin_pass --admin_email=$admin_email --allow-root
|
wp core install --url=$url --title="$title" --admin_name=$admin_name --admin_password=$admin_pass --admin_email=$admin_email --allow-root
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# download wordpress
|
||||||
|
curl -O https://wordpress.org/latest.tar.gz
|
||||||
|
# unzip wordpress
|
||||||
|
tar -zxvf latest.tar.gz
|
||||||
|
# change dir to wordpress
|
||||||
|
cd wordpress
|
||||||
|
# copy file to parent dir
|
||||||
|
cp -rf . ..
|
||||||
|
# move back to parent dir
|
||||||
|
cd ..
|
||||||
|
# remove files from wordpress folder
|
||||||
|
rm -R wordpress
|
||||||
|
# create wp config
|
||||||
|
cp wp-config-sample.php wp-config.php
|
||||||
|
# set database details with perl find and replace
|
||||||
|
perl -pi -e "s/database_name_here/$dbname/g" wp-config.php
|
||||||
|
perl -pi -e "s/username_here/$dbuser/g" wp-config.php
|
||||||
|
perl -pi -e "s/password_here/$dbpass/g" wp-config.php
|
||||||
|
|
||||||
|
# set WP salts
|
||||||
|
perl -i -pe'
|
||||||
|
BEGIN {
|
||||||
|
@chars = ("a" .. "z", "A" .. "Z", 0 .. 9);
|
||||||
|
push @chars, split //, "!@#$%^&*()-_ []{}<>~\`+=,.;:/?|";
|
||||||
|
sub salt { join "", map $chars[ rand @chars ], 1 .. 64 }
|
||||||
|
}
|
||||||
|
s/put your unique phrase here/salt()/ge
|
||||||
|
' wp-config.php
|
||||||
|
|
||||||
|
# create uploads folder and set permissions
|
||||||
|
mkdir wp-content/uploads
|
||||||
|
chmod 775 wp-content/uploads
|
||||||
|
echo "Cleaning..."
|
||||||
|
# remove zip file
|
||||||
|
rm latest.tar.gz
|
||||||
|
echo "========================="
|
||||||
|
echo "Installation is complete."
|
||||||
|
echo "========================="
|
||||||
|
fi
|
||||||
|
|
||||||
# Themes
|
# Themes
|
||||||
|
#wget --user username --ask-password -O path/to/output.zip https://bitbucket.org/path/to/file.zip
|
||||||
#wp theme install https://github.com/Automattic/_s/archive/master.zip --activate
|
#wp theme install https://github.com/Automattic/_s/archive/master.zip --activate
|
||||||
#wp scaffold child-theme sample-theme --parent_theme=twentysixteen
|
#wp scaffold child-theme sample-theme --parent_theme=twentysixteen
|
||||||
|
Loading…
Reference in New Issue
Block a user