diff --git a/scripts/install b/scripts/install index 84ef3db..aad55d3 100644 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#source ./_common.sh +source ./_common.sh source /usr/share/yunohost/helpers #================================================= @@ -37,6 +37,12 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +# Check if .well-known is available for this domain. +if is_url_handled "https://$domain/.well-known/caldav" || is_url_handled "https://$domain/.well-known/carddav" +then + ynh_die --message="Another app already uses the domain $domain to serve a caldav/carddav feature. Please use another domain." +fi + #================================================= # STORE SETTINGS FROM MANIFEST #================================================= diff --git a/scripts/restore b/scripts/restore index 686f8b0..ea0a26f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -# source ../settings/scripts/_common.sh +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= @@ -38,6 +38,12 @@ ynh_webpath_available --domain=$domain --path_url=$path_url \ test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " +# Check if .well-known is available for this domain. +if is_url_handled "https://$domain/.well-known/caldav" || is_url_handled "https://$domain/.well-known/carddav" +then + ynh_die --message="Another app already uses the domain $domain to serve a caldav/carddav feature. Please use another domain." +fi + #================================================= # STANDARD RESTORATION STEPS #=================================================