From 8a3c354254edc31a426f1dba4a426d020a72c3f7 Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 8 Sep 2020 20:33:56 +0100 Subject: [PATCH] remove plugin uninstall --- scripts/debian10/install-wordpress.sh | 86 +++++++++++++-------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/scripts/debian10/install-wordpress.sh b/scripts/debian10/install-wordpress.sh index 49db490..db46486 100755 --- a/scripts/debian10/install-wordpress.sh +++ b/scripts/debian10/install-wordpress.sh @@ -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 - 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 + # 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 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,42 +77,38 @@ 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 - mkdir -p /var/log/wordpress/ - cat << EOF > $config_path - - ServerName $domain - DocumentRoot $wp_path - ErrorLog /var/log/wordpress/error.log - CustomLog /var/log/wordpress/access.log combined - - AllowOverride All - - RewriteEngine On - RewriteBase / - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule . /index.php [L] - - - +if [ -n "$_apache2_version" ] ; then + ssh -T $ssh_root << EOSSH + if [ -n "$apache2_version" ] ; then + mkdir -p /var/log/wordpress/ + cat << EOF > /etc/apache2/sites-available/wordpress.conf + + ServerName $domain + DocumentRoot $wp_path + ErrorLog /var/log/wordpress/error.log + CustomLog /var/log/wordpress/access.log combined + + AllowOverride All + + RewriteEngine On + RewriteBase / + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /index.php [L] + + + EOF - a2enmod rewrite - a2ensite wordpress - a2dissite 000-default - systemctl reload apache2 -fi + a2enmod rewrite + a2ensite wordpress + a2dissite 000-default + systemctl reload apache2 + 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