mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
create a function for that
This commit is contained in:
parent
5556fb6549
commit
d7f9b2c9fd
2 changed files with 14 additions and 8 deletions
|
@ -8,6 +8,19 @@
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
wait_nginx_reload() {
|
||||||
|
# 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 an URL is already handled
|
# Check if an URL is already handled
|
||||||
# usage: is_url_handled --domain=DOMAIN --path=PATH_URI
|
# usage: is_url_handled --domain=DOMAIN --path=PATH_URI
|
||||||
is_url_handled() {
|
is_url_handled() {
|
||||||
|
|
|
@ -357,14 +357,7 @@ ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$a
|
||||||
# Wait untils NGINX has fully reloaded
|
# Wait untils NGINX has fully reloaded
|
||||||
ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd"
|
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.
|
wait_nginx_reload
|
||||||
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
|
# 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"
|
if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav"
|
||||||
|
|
Loading…
Add table
Reference in a new issue