From 1d31c6675236f21c37c336397b0e0da435288540 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 6 Mar 2022 20:24:38 +0100 Subject: [PATCH] Update restore --- scripts/restore | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/restore b/scripts/restore index 4609d56..e731788 100644 --- a/scripts/restore +++ b/scripts/restore @@ -40,9 +40,9 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) ynh_script_progression --message="Validating restoration parameters..." test ! -d $final_path \ - || ynh_die "There is already a directory: $final_path " + || ynh_die --message="There is already a directory: $final_path " test ! -d "/opt/yunohost/$app" \ - || ynh_die "There is already a directory: /opt/yunohost/$app " + || ynh_die --message="There is already a directory: /opt/yunohost/$app " #================================================= # ACTIVATE MAINTENANCE MODE @@ -71,11 +71,9 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restore the app main directory" +ynh_script_progression --message="Restoring the app main directory..." -ynh_restore_file "$final_path" -mkdir -p /opt/yunohost -ynh_restore_file "/opt/yunohost/$app" +ynh_restore_file --origin_path="$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -101,8 +99,6 @@ ynh_install_app_dependencies $pkg_dependencies # RESTORE USER RIGHTS #================================================= -chown radicale: -R /opt/yunohost/$app - chown -R radicale: $final_path mkdir -p /var/log/$app touch /var/log/$app/$app.log @@ -114,6 +110,9 @@ chown radicale -R /var/log/$app ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/$app" +mkdir -p /opt/yunohost +ynh_restore_file --origin_path="/opt/yunohost/$app" +chown radicale: -R /opt/yunohost/$app #================================================= # RESTORE THE UWSGI CONFIG