Update 99-run.sh

This commit is contained in:
Alexandre
2022-06-10 12:23:13 +02:00
committed by GitHub
parent f97bede989
commit 381f473000

View File

@@ -4,22 +4,37 @@
#################
# DATA_LOCATION #
#################
bashio::log.info "Setting data location"
DATA_LOCATION=$(bashio::config 'data_location')
echo "Setting permissions"
mkdir -p "$DATA_LOCATION"
chown -R "$(bashio::config 'PUID'):$(bashio::config 'PGID')" "$DATA_LOCATION"
chmod -R 755 "$DATA_LOCATION"
echo "Copying data"
cp -n /shared "$DATA_LOCATION"
rm -r /shared
sed -i "s|/shared|$DATA_LOCATION|g" "/docker_entrypoint.sh"
sed -i "s|/shared|$DATA_LOCATION|g" "/scripts/*"
sed -i "s|SEAFILE_CONF_DIR=./seafile/conf|SEAFILE_CONF_DIR=$DATA_LOCATION/conf|g" "$ENVFILE"
sed -i "s|SEAFILE_LOGS_DIR=./seafile/logs|SEAFILE_LOGS_DIR=$DATA_LOCATION/logs|g" "$ENVFILE"
sed -i "s|SEAFILE_DATA_DIR=./seafile/seafile-data|SEAFILE_DATA_DIR=$DATA_LOCATION/seafile-data|g" "$ENVFILE"
sed -i "s|SEAFILE_SEAHUB_DIR=./seafile/seahub-data|SEAFILE_SEAHUB_DIR=$DATA_LOCATION/seahub-data|g" "$ENVFILE"
sed -i "s|SEAFILE_SQLITE_DIR=./seafile/sqlite|SSEAFILE_SQLITE_DIR=$DATA_LOCATION/sqlite|g" "$ENVFILE"
sed -i "s|DATABASE_DIR=./db|DATABASE_DIR=$DATA_LOCATION/db|g" "$ENVFILE"
echo "Creating symlink"
ln -sf "$DATA_LOCATION" /shared
#sed -i "s|/shared|$DATA_LOCATION|g" "/docker_entrypoint.sh"
#sed -i "s|/shared|$DATA_LOCATION|g" "/scripts/*"
#sed -i "s|SEAFILE_CONF_DIR=./seafile/conf|SEAFILE_CONF_DIR=$DATA_LOCATION/conf|g" "$ENVFILE"
#sed -i "s|SEAFILE_LOGS_DIR=./seafile/logs|SEAFILE_LOGS_DIR=$DATA_LOCATION/logs|g" "$ENVFILE"
#sed -i "s|SEAFILE_DATA_DIR=./seafile/seafile-data|SEAFILE_DATA_DIR=$DATA_LOCATION/seafile-data|g" "$ENVFILE"
#sed -i "s|SEAFILE_SEAHUB_DIR=./seafile/seahub-data|SEAFILE_SEAHUB_DIR=$DATA_LOCATION/seahub-data|g" "$ENVFILE"
#sed -i "s|SEAFILE_SQLITE_DIR=./seafile/sqlite|SSEAFILE_SQLITE_DIR=$DATA_LOCATION/sqlite|g" "$ENVFILE"
#sed -i "s|DATABASE_DIR=./db|DATABASE_DIR=$DATA_LOCATION/db|g" "$ENVFILE"
####################
# GLOBAL VARIABLES #
####################
bashio::log.info "Setting variables"
ENVFILE="/.env"
cp /defaults/.env.example "$ENVFILE"
@@ -35,7 +50,9 @@ if bashio::config.has_value "SEAFILE_ADMIN_EMAIL"; then sed -i "s|SEAFILE_ADMIN_
###################
# Define database #
###################
bashio::log.info "Defining database"
case $(bashio::config 'database') in
# Use sqlite