mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-14 11:31:31 +02:00
clean
This commit is contained in:
@@ -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
|
||||
@@ -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 #
|
||||
|
||||
Reference in New Issue
Block a user