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
ssh -T $ssh_root << EOSSH
# install wp-cli first
if [ ! -f /usr/local/bin/wp ] ; then
# install wp-cli first
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 \
&& chmod +x /usr/local/bin/wp
fi
fi
EOSSH
ssh -T $ssh_user << EOSSH
if wp core is-installed --quiet --path="$wp_path" ; then
echo "WordPress already installed"
else
echo "wp core download \
--version=$wp_version \
--path=$wp_path \
--skip-content \
--locale=$wp_locale"
wp core download \
--version="$wp_version" \
--path="$wp_path" \
@ -73,22 +77,11 @@ EOSSH
done
fi
if [ -n "$wp_plugins_active" ] ; then
printf "\nUninstalling plugins ..."
for plugin in $wp_plugins_uninstall ; do
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
if [ -n "$_apache2_version" ] ; then
ssh -T $ssh_root << EOSSH
if [ -n "$apache2_version" ] ; then
mkdir -p /var/log/wordpress/
cat << EOF > $config_path
cat << EOF > /etc/apache2/sites-available/wordpress.conf
<VirtualHost *:80>
ServerName $domain
DocumentRoot $wp_path
@ -110,5 +103,12 @@ EOF
a2ensite wordpress
a2dissite 000-default
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
fi