From 3ea8483c6b23d7d4432e616b3b1e19092d67c792 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 1 Aug 2022 11:15:03 +0200 Subject: [PATCH] install_dehydrated.sh: if both, apache2 and nginx, are installed script created update_ssl_directives.sh didn't work if apache2 is active. --- install_dehydrated.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/install_dehydrated.sh b/install_dehydrated.sh index 71fa56b..75bda0b 100755 --- a/install_dehydrated.sh +++ b/install_dehydrated.sh @@ -3442,26 +3442,30 @@ _DH_BASE_DIR=$DH_BASE_DIR _APACHE_VHOST_DIR=$APACHE_VHOST_DIR _NGINX_VHOST_DIR=$NGINX_VHOST_DIR -if [[ ! -d "\$_APACHE_VHOST_DIR" ]]; then - if [[ -d "/etc/apache2/sites-available" ]]; then - _VHOST_DIR=/etc/apache2/conf-available - elif [[ -d "/usr/local/apache2/conf/vhosts" ]]; then - if [[ -d "/usr/local/apache2/conf/vhosts/0" ]]; then - _VHOST_DIR=/usr/local/apache2/conf/vhosts/0 - else - _VHOST_DIR=/usr/local/apache2/conf/vhosts +if [[ -n "\$_APACHE_VHOST_DIR" ]] ; then + if [[ ! -d "\$_APACHE_VHOST_DIR" ]]; then + if [[ -d "/etc/apache2/sites-available" ]]; then + _VHOST_DIR=/etc/apache2/conf-available + elif [[ -d "/usr/local/apache2/conf/vhosts" ]]; then + if [[ -d "/usr/local/apache2/conf/vhosts/0" ]]; then + _VHOST_DIR=/usr/local/apache2/conf/vhosts/0 + else + _VHOST_DIR=/usr/local/apache2/conf/vhosts + fi fi + else + _VHOST_DIR=\$_APACHE_VHOST_DIR fi -else - _VHOST_DIR=\$_APACHE_VHOST_DIR fi -if [[ ! -d "\$_NGINX_VHOST_DIR" ]]; then - if [[ -d "/etc/nginx/sites-available" ]]; then +if [[ -n "\$_NGINX_VHOST_DIR" ]] ; then + if [[ ! -d "\$_NGINX_VHOST_DIR" ]]; then + if [[ -d "/etc/nginx/sites-available" ]]; then + _VHOST_DIR=\$_NGINX_VHOST_DIR + fi + else _VHOST_DIR=\$_NGINX_VHOST_DIR fi -else - _VHOST_DIR=\$_NGINX_VHOST_DIR fi _apache_debian_install=false