mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
Move config to /config
This commit is contained in:
@@ -30,9 +30,6 @@ change_folders() {
|
|||||||
|
|
||||||
# Adapt sync.conf
|
# Adapt sync.conf
|
||||||
for FILE in "$ORIGINALLOCATION/sync.conf" "$CONFIGLOCATION/sync.conf" "/defaults/sync.conf"; do
|
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
|
if [ "$TYPE" = "data_location" ]; then
|
||||||
[ -f "$FILE" ] && jq --arg variable "$CONFIGLOCATION" '.directory_root = $variable' "$FILE" | sponge "$FILE"
|
[ -f "$FILE" ] && jq --arg variable "$CONFIGLOCATION" '.directory_root = $variable' "$FILE" | sponge "$FILE"
|
||||||
fi
|
fi
|
||||||
@@ -67,13 +64,16 @@ change_folders() {
|
|||||||
########################
|
########################
|
||||||
|
|
||||||
# Adapt files
|
# 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 'data_location')" "/share/resiliosync" "data_location"
|
||||||
change_folders "$(bashio::config 'downloads_location')" "/share/resiliosync_downloads" "downloads_location"
|
change_folders "$(bashio::config 'downloads_location')" "/share/resiliosync_downloads" "downloads_location"
|
||||||
|
|
||||||
if [[ ! -e "$(bashio::config 'config_location')"/sync.conf ]]; then
|
# Ensure configuration is in /config
|
||||||
cp /defaults/sync.conf "$(bashio::config 'config_location')"/sync.conf
|
if [[ ! -e /config/sync.conf ]]; then
|
||||||
|
cp /defaults/sync.conf /config/sync.conf
|
||||||
fi
|
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
|
# Add directories to dir_whitelist if missing
|
||||||
DIRS_TO_ADD=("/backup" "/media" "/share" "/addons")
|
DIRS_TO_ADD=("/backup" "/media" "/share" "/addons")
|
||||||
|
|||||||
Reference in New Issue
Block a user