From 38b620bcb3ced9c09a0ea25d8246d71ccdb3fa2b Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 6 Apr 2020 11:02:34 +0200 Subject: [PATCH] Override file 000-dehydrated.conf even if it exists yet. --- install_dehydrated.sh | 60 ++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/install_dehydrated.sh b/install_dehydrated.sh index 4b989bb..920251d 100755 --- a/install_dehydrated.sh +++ b/install_dehydrated.sh @@ -375,33 +375,30 @@ if [[ -n "$APACHE_CONF_DIR" ]]; then _apache_dh_conf_file=${APACHE_CONF_DIR}/000-dehydrated.conf echononl " Configure Apache Webserver: Create alias for WELL-KNOWN Directory.." - if [[ -f "$_apache_dh_conf_file" ]] ; then - echo_skipped - else - if [[ -x "$apache_control_script" ]] && $apache_control_script -M 2> /dev/null | grep -q version_module > /dev/null 2>&1 ; then - cat << EOF > $_apache_dh_conf_file -Alias /.well-known/acme-challenge /var/www/dehydrated/ + if [[ -x "$apache_control_script" ]] && $apache_control_script -M 2> /dev/null | grep -q version_module > /dev/null 2>&1 ; then + cat << EOF > $_apache_dh_conf_file +Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/ - Options +FollowSymLinks - AllowOverride None - - Order allow,deny - Allow from all - - = 2.4> - Require all granted - Satisfy Any - +Options +FollowSymLinks +AllowOverride None + + Order allow,deny + Allow from all + += 2.4> + Require all granted + Satisfy Any + EOF - if [[ $? -eq 0 ]] ; then - echo_ok - else - echo_failed - fi + if [[ $? -eq 0 ]] ; then + echo_ok else - cat << EOF > $_apache_dh_conf_file + echo_failed + fi + else + cat << EOF > $_apache_dh_conf_file Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/ # - Notice: @@ -411,20 +408,19 @@ Alias /.well-known/acme-challenge ${DH_WELL_KNOWN_DIR}/ # - Allow from all # - - Options +FollowSymLinks - AllowOverride None - Require all granted - Satisfy Any +Options +FollowSymLinks +AllowOverride None +Require all granted +Satisfy Any EOF - if [[ $? -eq 0 ]] ; then - echo_ok - else - echo_failed - fi + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed fi - apache_config_changed=true fi + apache_config_changed=true if $_set_apache_conf_symlink ; then echononl " Activate \"000-dehydrated.conf\" .. "