Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hansson <github@techandme.se>2018-08-17 20:39:17 +0300
committerGitHub <noreply@github.com>2018-08-17 20:39:17 +0300
commite68b13a4a84ae8b1ff0c3fff2e9e06b3b48ab909 (patch)
treeb521f12ff1622105bd8ff3e1d30b93d988f4e9bc /lets-encrypt
parent879e492c5326e3dd3efa4298654a5a2db5e39b92 (diff)
make SSL config backwards compatible (#630)
Diffstat (limited to 'lets-encrypt')
-rw-r--r--lets-encrypt/activate-ssl.sh30
1 files changed, 13 insertions, 17 deletions
diff --git a/lets-encrypt/activate-ssl.sh b/lets-encrypt/activate-ssl.sh
index 4d3c12dd..dbcb12c8 100644
--- a/lets-encrypt/activate-ssl.sh
+++ b/lets-encrypt/activate-ssl.sh
@@ -15,23 +15,6 @@ debug_mode
# Check if root
root_check
-# You can't run the script if you are not using PHP-FPM
-if [ -f "$PHP_POOL_DIR"/nextcloud.conf ]
-then
- sleep 0.1
-elif dpkg -s php7.2-fpm | grep "Status: install ok installed" &>/dev/null
-then
- sleep 0.1
-elif dpkg -s php-fpm | grep "Status: install ok installed" &>/dev/null
-then
- sleep 0.1
-else
-msg_box "You can't use this script without PHP-FPM at the moment, we are working on a fix to make it backwards compatible.
-
-Thank you for understanding."
-exit
-fi
-
# Information
msg_box "Important! Please read this:
@@ -208,6 +191,19 @@ then
SSL_CREATE
fi
+# Check if PHP-FPM is installed and if not, then remove PHP-FPM related lines from config
+if [ ! -f "$PHP_POOL_DIR"/nextcloud.conf ]
+then
+ sed -i "s|<FilesMatch.*|# Removed due to that PHP-FPM is missing|g" "$ssl_conf"
+ sed -i "s|SetHandler.*|#|g" "$ssl_conf"
+ sed -i "s|</FilesMatch.*|#|g" "$ssl_conf"
+elif ! dpkg -s php7.2-fpm | grep "Status: install ok installed" >/dev/null 2>&1
+then
+ sed -i "s|<FilesMatch.*|# Removed due to that PHP-FPM is missing|g" "$1"
+ sed -i "s|SetHandler.*|#|g" "$ssl_conf"
+ sed -i "s|</FilesMatch.*|#|g" "$ssl_conf"
+fi
+
# Methods
default_le="--rsa-key-size 4096 --renew-by-default --agree-tos -d $domain"