diff --git a/scripts/install b/scripts/install index 3f3a88f..f2cd182 100644 --- a/scripts/install +++ b/scripts/install @@ -35,11 +35,14 @@ workdir=$(pwd) port=$(ynh_find_port 3000) # Check domain/path availability -sudo yunohost app checkurl $domain -a $app +ynh_webpath_available $domain $path if [[ ! $? -eq 0 ]]; then ynh_die "domain not available" fi +# Register/book a web path for an app +ynh_webpath_register $app $domain $path + final_path="/var/lib/$app" [[ -d $final_path ]] && ynh_die \ "The destination directory '$final_path' already exists.\ diff --git a/scripts/restore b/scripts/restore index d92bfe7..e776f88 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,7 +34,13 @@ serviceuser=$(ynh_app_setting_get $app serviceuser) port=$(ynh_app_setting_get $app port) # Check domain/path availability -sudo yunohost app checkurl "${domain}${path}" -a "$app" || ynh_die +ynh_webpath_available $domain $path +if [[ ! $? -eq 0 ]]; then + ynh_die "domain not available" +fi + +# Register/book a web path for an app +ynh_webpath_register $app $domain $path # Check destination directory [[ -d $final_path ]] && ynh_die \