This commit is contained in:
Alexandre
2026-06-03 10:25:23 +02:00
committed by GitHub
parent 9f2cd2ef39
commit 3b791ccc8f
2 changed files with 2 additions and 43 deletions

View File

@@ -1,42 +0,0 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
set -e
####################
# Migrate database #
####################
if [ -f /homeassistant/addons_config/filebrowser_quantum/filebrowser_quantum.db ]; then
echo "Moving database to new location /config"
cp -rnf /homeassistant/addons_config/filebrowser_quantum/* /config/
rm -r /homeassistant/addons_config/filebrowser_quantum
fi
######################
# Link addon folders #
######################
# Clean symlinks
find /config -maxdepth 1 -type l -delete
if [ -d /homeassistant/addons_config ]; then
find /homeassistant/addons_config -maxdepth 1 -type l -delete
fi
# Remove erroneous folders
if [ -d /homeassistant ]; then
if [ -d /config/addons_config ]; then
rm -r /config/addons_config
fi
if [ -d /config/addons_autoscripts ]; then
rm -r /config/addons_autoscripts
fi
fi
# Create symlinks with legacy folders
if [ -d /homeassistant/addons_config ]; then
ln -s /homeassistant/addons_config /config
find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser_quantum*" -exec ln -s {} /config/addons_config/ \;
fi
if [ -d /homeassistant/addons_autoscripts ]; then
ln -s /homeassistant/addons_autoscripts /config
fi

View File

@@ -68,7 +68,7 @@ mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
CONFIG_PATH="/config/filebrowser_quantum.yaml"
mkdir -p /config /cache
export FILEBROWSER_CONFIG="${CONFIG_PATH}"
if [ !-f "$CONFIG_PATH" ]; then
python3 - <<'PY'
import json
@@ -222,6 +222,7 @@ with open(config_path, "w", encoding="utf-8") as f:
json.dump(config, f, indent=2)
f.write("\n")
PY
fi
######################
# LAUNCH FILEBROWSER #