mirror of
https://github.com/ggogel/seafile-containerized.git
synced 2024-11-16 17:05:32 +00:00
Merge branch 'move' into clusterV2
This commit is contained in:
commit
18b6816e69
47
seafile/scripts/create_data_links_copy2.sh
Normal file
47
seafile/scripts/create_data_links_copy2.sh
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
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
|
||||||
|
rm -rf /opt/seafile/$d && ln -sf $src /opt/seafile
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -e /shared/logs/seafile ]]; then
|
||||||
|
mv /shared/logs/seafile /shared/seafile/logs
|
||||||
|
rm -rf /opt/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/
|
||||||
|
else
|
||||||
|
mkdir -p /shared/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -e /shared/logs/var-log ]]; then
|
||||||
|
mkdir -p /shared/logs/ && mv /var/log /shared/logs/var-log
|
||||||
|
fi
|
||||||
|
rm -rf /var/log && ln -sf /shared/logs/var-log /var/log
|
Loading…
Reference in a new issue