Update 20-folders.sh

This commit is contained in:
Alexandre
2023-11-25 16:13:31 +01:00
committed by GitHub
parent acf481950d
commit dd0b568427

View File

@@ -2,6 +2,10 @@
# shellcheck shell=bash
set -e
####################
# Migrate database #
####################
if [ -f /config/addons_config/filebrowser/filebrowser.d* ]; then
echo "Moving database to new location /config"
mkdir -p /config
@@ -9,3 +13,17 @@ if [ -f /config/addons_config/filebrowser/filebrowser.d* ]; then
cp -rnf /config/addons_config/filebrowser/* /config/
rm -r /config/addons_config/filebrowser
fi
######################
# Link addon folders #
######################
# Clean symlinks
find /config -maxdepth 1 -type l -delete
find /homeassistant/addons_config -maxdepth 1 -type l -delete
# Create symlinks
ln -fs /homeassistant/addons_config /config
ln -fs /homeassistant/addons_autoscripts /config
for folders in $(find /addon_configs -maxdepth 1 -type d -not -name "*filebrowser*"); do
ln -fs ${folders} /config/addons_config
done