remove plugin uninstall

This commit is contained in:
Ray Elliott 2020-09-08 20:33:56 +01:00
parent bbc106c018
commit 8a3c354254
1 changed files with 43 additions and 43 deletions

View File

@ -4,18 +4,22 @@ echo "Installing WordPress .."
[ -z "$ssh_user" ] || [ -z "$ssh_root" ] && echo "Error: user and root ssh configuration must be specified" && exit 5 [ -z "$ssh_user" ] || [ -z "$ssh_root" ] && echo "Error: user and root ssh configuration must be specified" && exit 5
ssh -T $ssh_root << EOSSH ssh -T $ssh_root << EOSSH
# install wp-cli first
# install wp-cli first if [ ! -f /usr/local/bin/wp ] ; then
if [ ! -f /usr/local/bin/wp ] ; then
wget -nv -O /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ wget -nv -O /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x /usr/local/bin/wp && chmod +x /usr/local/bin/wp
fi fi
EOSSH EOSSH
ssh -T $ssh_user << EOSSH ssh -T $ssh_user << EOSSH
if wp core is-installed --quiet --path="$wp_path" ; then if wp core is-installed --quiet --path="$wp_path" ; then
echo "WordPress already installed" echo "WordPress already installed"
else else
echo "wp core download \
--version=$wp_version \
--path=$wp_path \
--skip-content \
--locale=$wp_locale"
wp core download \ wp core download \
--version="$wp_version" \ --version="$wp_version" \
--path="$wp_path" \ --path="$wp_path" \
@ -73,22 +77,11 @@ EOSSH
done done
fi fi
if [ -n "$wp_plugins_active" ] ; then if [ -n "$_apache2_version" ] ; then
printf "\nUninstalling plugins ..." ssh -T $ssh_root << EOSSH
for plugin in $wp_plugins_uninstall ; do if [ -n "$apache2_version" ] ; then
echo " installing $plugin ..."
ssh -T $ssh_user << EOSSH
wp plugin deactivate $plugin --path="$wp_path"
wp plugin uninstall $plugin --path="$wp_path"
EOSSH
done
fi
config_path='/etc/apache2/sites-available/wordpress.conf'
ssh -T $ssh_root << EOSSH
if [ -n "$apache2_version" ] ; then
mkdir -p /var/log/wordpress/ mkdir -p /var/log/wordpress/
cat << EOF > $config_path cat << EOF > /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80> <VirtualHost *:80>
ServerName $domain ServerName $domain
DocumentRoot $wp_path DocumentRoot $wp_path
@ -110,5 +103,12 @@ EOF
a2ensite wordpress a2ensite wordpress
a2dissite 000-default a2dissite 000-default
systemctl reload apache2 systemctl reload apache2
fi elif [ -n "nginx_version" ] ; then
echo "TODO - nginx wordpress config"
elif [ -n "litespeed_version" ] ; then
echo "TODO - litespeed wordpress config"
else
echo "Warning: no webserver configuration found"
fi
EOSSH EOSSH
fi