mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Move config to /config
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user