Move config to /config

This commit is contained in:
Alexandre
2025-06-25 09:20:38 +02:00
committed by GitHub
parent c839f23ddf
commit a3caa66a87

View File

@@ -30,9 +30,6 @@ change_folders() {
# Adapt sync.conf
for FILE in "$ORIGINALLOCATION/sync.conf" "$CONFIGLOCATION/sync.conf" "/defaults/sync.conf"; do
if [ "$TYPE" = "config_location" ]; then
[ -f "$FILE" ] && jq --arg variable "$CONFIGLOCATION" '.storage_path = $variable' "$FILE" | sponge "$FILE"
fi
if [ "$TYPE" = "data_location" ]; then
[ -f "$FILE" ] && jq --arg variable "$CONFIGLOCATION" '.directory_root = $variable' "$FILE" | sponge "$FILE"
fi
@@ -67,13 +64,16 @@ change_folders() {
########################
# Adapt files
change_folders "$(bashio::config 'config_location')" "/share/resiliosync_config" "config_location"
change_folders "$(bashio::config 'data_location')" "/share/resiliosync" "data_location"
change_folders "$(bashio::config 'downloads_location')" "/share/resiliosync_downloads" "downloads_location"
if [[ ! -e "$(bashio::config 'config_location')"/sync.conf ]]; then
cp /defaults/sync.conf "$(bashio::config 'config_location')"/sync.conf
# Ensure configuration is in /config
if [[ ! -e /config/sync.conf ]]; then
cp /defaults/sync.conf /config/sync.conf
fi
jq '.storage_path = "/config"' /config/sync.conf | sponge /config/sync.conf
chown -R "$PUID":"$PGID" /config
chmod -R 777 /config
# Add directories to dir_whitelist if missing
DIRS_TO_ADD=("/backup" "/media" "/share" "/addons")