Fix seafile-data link management

This commit is contained in:
Josué Tille 2023-10-26 11:14:43 +02:00
parent c94e9d1f1a
commit 471971419b
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF

View file

@ -65,8 +65,9 @@ if [ -z ${seahub_secret_key:-} ]; then
fi fi
# Update data dir if needed # Update data dir if needed
if [ $(readlink $install_dir/seafile-data) == '/home/yunohost.app/seafile-data' ]; then if [ ! -L /home/yunohost.app/seafile-data ] || \
rm $install_dir/seafile-data [ $(readlink $install_dir/seafile-data) = '/home/yunohost.app/seafile-data' ]; then
mv $install_dir/seafile-data $install_dir/seafile-data$(date '+%Y%m%d.%H%M%S')
ln -s $data_dir $install_dir/seafile-data ln -s $data_dir $install_dir/seafile-data
fi fi
if [ -e /home/yunohost.app/seafile-data ]; then if [ -e /home/yunohost.app/seafile-data ]; then
@ -117,10 +118,10 @@ case $installed_version in
# Fix seafile data link. Look like that the upgrade script of seafile don't always work correctly # Fix seafile data link. Look like that the upgrade script of seafile don't always work correctly
if [ -e $install_dir/seafile-data ]; then if [ -e $install_dir/seafile-data ]; then
old_data_dir_path="$install_dir/seafile_data$(date '+%Y%m%d.%H%M%S')" old_data_dir_path="$install_dir/seafile-data$(date '+%Y%m%d.%H%M%S')"
mv "$install_dir/seafile-data" "$old_data_dir_path" mv "$install_dir/seafile-data" "$old_data_dir_path"
fi fi
ln -s $seafile_data $install_dir/seafile-data ln -s $data_dir $install_dir/seafile-data
;& ;&
"7.1."* ) "7.1."* )
sudo -u $YNH_APP_ID $expect_scripts_dir/upgrade_8.0.exp $install_dir/seafile-server-$seafile_version sudo -u $YNH_APP_ID $expect_scripts_dir/upgrade_8.0.exp $install_dir/seafile-server-$seafile_version