From ed063b11e983588dd106e118670ecba03f1104d4 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:39:14 +0100 Subject: [PATCH] Update 20-folders.sh --- .../rootfs/etc/cont-init.d/20-folders.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/filebrowser/rootfs/etc/cont-init.d/20-folders.sh b/filebrowser/rootfs/etc/cont-init.d/20-folders.sh index 068e4f6e2b6..3debc2bf9d5 100755 --- a/filebrowser/rootfs/etc/cont-init.d/20-folders.sh +++ b/filebrowser/rootfs/etc/cont-init.d/20-folders.sh @@ -21,9 +21,20 @@ fi # Clean symlinks find /config -maxdepth 1 -type l -delete find /homeassistant/addons_config -maxdepth 1 -type l -delete +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 -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 +ln -s /homeassistant/addons_config /config +ln -s /homeassistant/addons_autoscripts /config + +for folders in $(find /addon_configs/ -maxdepth 1 -mindepth 1 -type d -not -name "*filebrowser*"); do + ln -fs "${folders}" /config/addons_config/ + echo $folders done