seafile-containerized/seafile-server/scripts/create_data_links.sh

47 lines
852 B
Bash
Raw Permalink Normal View History

2021-01-17 23:45:50 +00:00
#!/bin/bash
set -e
2021-01-17 23:45:50 +00:00
set -o pipefail
if [[ $SEAFILE_BOOTSRAP != "" ]]; then
exit 0
fi
if [[ $TIME_ZONE != "" ]]; then
time_zone=/usr/share/zoneinfo/$TIME_ZONE
if [[ ! -e $time_zone ]]; then
echo "invalid time zone"
exit 1
else
ln -snf $time_zone /etc/localtime
echo "$TIME_ZONE" > /etc/timezone
fi
fi
dirs=(
conf
ccnet
seafile-data
seahub-data
pro-data
seafile-license.txt
)
for d in ${dirs[*]}; do
src=/shared/seafile/$d
if [[ -e $src ]]; then
2021-11-11 16:55:19 +00:00
rm -rf /opt/seafile/$d
ln -sf $src /opt/seafile
2021-01-17 23:45:50 +00:00
fi
done
if [[ -e /shared/logs/seafile ]]; then
rm -rf /shared/logs/seafile /shared/seafile/logs
2021-01-17 23:45:50 +00:00
fi
if [[ -e /shared/seafile/logs ]]; then
rm -rf /shared/seafile/logs
fi
if [[ -e /shared/logs/var-log ]]; then
rm -rf /shared/logs/var-log
2021-01-17 23:45:50 +00:00
fi