diff --git a/scripts/_common.sh b/scripts/_common.sh index 47253f1..7b84705 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,9 +38,6 @@ is_url_handled() { # Manage arguments with getopts ynh_handle_getopts_args "$@" - # Wait untils nginx has fully reloaded (avoid curl fail with http2) - sleep 2 - # Try to get the url with curl, and keep the http code and an eventual redirection url. local curl_output="$(curl --insecure --silent --output /dev/null \ --write-out '%{http_code};%{redirect_url}' https://127.0.0.1$path --header "Host: $domain" --resolve $domain:443:127.0.0.1)" diff --git a/scripts/upgrade b/scripts/upgrade index 0f0da06..9045c6f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -146,7 +146,7 @@ ynh_install_php --phpversion="$YNH_PHP_VERSION" --package="$extra_pkg_dependenci #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=3 ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -156,6 +156,9 @@ ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$a ynh_systemd_action --service_name=nginx --action=reload +# Wait untils nginx has fully reloaded +sleep 1 + # Check if .well-known is available for this domain if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then