From c1246d9177ac29da92f7a4b5e13eab5961b59d9b Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 25 Jun 2025 14:48:02 +0200 Subject: [PATCH] Update 01-folders.sh --- resiliosync/rootfs/etc/cont-init.d/01-folders.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/resiliosync/rootfs/etc/cont-init.d/01-folders.sh b/resiliosync/rootfs/etc/cont-init.d/01-folders.sh index 5cf8d8d84..4bffe5dee 100755 --- a/resiliosync/rootfs/etc/cont-init.d/01-folders.sh +++ b/resiliosync/rootfs/etc/cont-init.d/01-folders.sh @@ -77,14 +77,10 @@ chmod -R 777 /config # Add directories to dir_whitelist if missing DIRS_TO_ADD=("/backup" "/media" "/share" "/addons") -for CONFIG_FILE in "$(bashio::config 'config_location')/sync.conf" "/defaults/sync.conf"; do - if [ -f "$CONFIG_FILE" ]; then - echo "Checking dir_whitelist in $CONFIG_FILE" - for DIR in "${DIRS_TO_ADD[@]}"; do - if ! jq -e ".webui.dir_whitelist | index(\"$DIR\")" "$CONFIG_FILE" >/dev/null; then - echo "Adding $DIR to dir_whitelist" - jq ".webui.dir_whitelist += [\"$DIR\"]" "$CONFIG_FILE" | sponge "$CONFIG_FILE" - fi - done +echo "Checking dir_whitelist in /config/sync.json" +for DIR in "${DIRS_TO_ADD[@]}"; do + if ! jq -e ".webui.dir_whitelist | index(\"$DIR\")" /config/sync.json >/dev/null; then + echo "Adding $DIR to dir_whitelist" + jq ".webui.dir_whitelist += [\"$DIR\"]" /config/sync.json | sponge /config/sync.json fi done