From 5ca79c9d9618a12a8426805dab9217cda65573cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 1 May 2020 16:39:15 +0200 Subject: [PATCH] Fix seafile_data management --- scripts/upgrade | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 772e47c..dea0f9e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,8 +70,12 @@ if [ $final_path == "/var/www/$app" ]; then ynh_system_user_create --username $seafile_user --home_dir $final_path ynh_app_setting_set --app $app --key final_path --value $final_path test -e /var/log/seafile && rm /var/log/$app - echo '/home/yunohost.app/seafile-data' > /opt/yunohost/seafile/ccnet/seafile.ini - mv /opt/yunohost/$app/seafile-data/* /home/yunohost.app/seafile-data/ + if ! [ -z "$(ls -A $final_path/seafile_data)" ]; then + # Data directory empty, so considere that all data are already in /home/yunohost.app/seafile + mv /opt/yunohost/$app/seafile-data/* /home/yunohost.app/seafile-data/ + ynh_secure_remove $final_path/seafile_data + ln -s $seafile_data $final_path/seafile_data + fi ln -s $final_path/logs /var/log/seafile set_permission fi