From 5556fb6549d8602ba0ccd8455f2c081065f6692d Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 1 Aug 2024 11:44:40 +0200 Subject: [PATCH] wait until nginx has actually remove the nextcloud conf during upgrade before checking the url_handled --- scripts/upgrade | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index e36d62e..aa391c0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -357,6 +357,15 @@ ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$a # Wait untils NGINX has fully reloaded ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd" +# Nginx may take some time to support the new configuration, wait for the nextcloud configuration file to disappear from nginx before checking the CalDAV/CardDAV URL. +timeout=30 +for i in $(seq 1 $timeout); do + if ! ynh_exec_warn_less nginx -T | grep --quiet "# configuration file /etc/nginx/conf.d/$domain.d/$app.conf:"; then + break + fi + sleep 1 +done + # 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