From 42c7be4c056bdc42fd18dc7fd4671d8f0b9c25bb Mon Sep 17 00:00:00 2001 From: Shuai Lin Date: Mon, 28 Nov 2016 15:06:23 +0800 Subject: [PATCH] Minor-upgrade: support media/custom dir. --- image/seafile/create_data_links.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/image/seafile/create_data_links.sh b/image/seafile/create_data_links.sh index ef18183..6c1cc79 100755 --- a/image/seafile/create_data_links.sh +++ b/image/seafile/create_data_links.sh @@ -25,13 +25,19 @@ if [[ -e /shared/logs/seafile ]]; then ln -sf /shared/logs/seafile/ /opt/seafile/logs fi -if [[ ! -e /opt/seafile/seafile-server-latest ]]; then - ln -sf /opt/seafile/seafile-server-$SEAFILE_VERSION /opt/seafile/seafile-server-latest +current_version_dir=/opt/seafile/seafile-server-${SEAFILE_VERSION} +latest_version_dir=/opt/seafile/seafile-server-latest +seahub_data_dir=/shared/seafile/seahub-data + +if [[ ! -e ${latest_version_dir} ]]; then + ln -sf ${current_version_dir} ${latest_version_dir} fi -source_avatars_dir=/opt/seafile/seafile-server-${SEAFILE_VERSION}/seahub/media/avatars +source_avatars_dir=${current_version_dir}/seahub/media/avatars rm -rf $source_avatars_dir +ln -sf ${seahub_data_dir}/avatars $source_avatars_dir -ln -sf /shared/seafile/seahub-data/avatars $source_avatars_dir - -# TODO: create avatars link +source_custom_dir=${current_version_dir}/seahub/media/custom +rm -rf $source_custom_dir +mkdir -p ${seahub_data_dir}/custom +ln -sf ${seahub_data_dir}/custom $source_custom_dir