From 5791e0dc90ac72384cb87b8f3d1d01793b95f4c1 Mon Sep 17 00:00:00 2001 From: aymhce Date: Sun, 3 Sep 2017 21:11:33 +0000 Subject: [PATCH] fix deprecated ynh cmd --- scripts/install | 4 +++- scripts/restore | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 8a5864a..6b513db 100755 --- a/scripts/install +++ b/scripts/install @@ -15,7 +15,9 @@ admin=$YNH_APP_ARG_ADMIN ynh_app_setting_set "$app" admin "$admin" # Check domain/path availability -sudo yunohost app checkurl "${domain}${path}" -a "$app" || ynh_die "Path not available: ${domain}${path}" +path=$(ynh_normalize_url_path $path) +ynh_webpath_available $domain $path +ynh_webpath_register $app $domain $path # Copy files to the right place version=$(cat upstream_version) diff --git a/scripts/restore b/scripts/restore index 7fd569c..4fdb377 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,11 +10,13 @@ domain=$(ynh_app_setting_get "$app" domain) path=$(ynh_app_setting_get "$app" path) admin=$(ynh_app_setting_get "$app" admin) -yunohost app checkurl "${domain}${path}" -a "$app" \ - || ynh_die "Path not available: ${domain}${path}" test ! -d /var/www/$app \ || ynh_die "There is already a directory: /var/www/$app " +path=$(ynh_normalize_url_path $path) +ynh_webpath_available $domain $path +ynh_webpath_register $app $domain $path + sudo cp -a ./sources "/var/www/$app" cp -a ./conf/nginx.conf "/etc/nginx/conf.d/$domain.d/$app.conf"