mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 22:04:06 +02:00
Update 01-folders.sh
This commit is contained in:
@@ -77,14 +77,10 @@ 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")
|
||||||
for CONFIG_FILE in "$(bashio::config 'config_location')/sync.conf" "/defaults/sync.conf"; do
|
echo "Checking dir_whitelist in /config/sync.json"
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
for DIR in "${DIRS_TO_ADD[@]}"; do
|
||||||
echo "Checking dir_whitelist in $CONFIG_FILE"
|
if ! jq -e ".webui.dir_whitelist | index(\"$DIR\")" /config/sync.json >/dev/null; then
|
||||||
for DIR in "${DIRS_TO_ADD[@]}"; do
|
echo "Adding $DIR to dir_whitelist"
|
||||||
if ! jq -e ".webui.dir_whitelist | index(\"$DIR\")" "$CONFIG_FILE" >/dev/null; then
|
jq ".webui.dir_whitelist += [\"$DIR\"]" /config/sync.json | sponge /config/sync.json
|
||||||
echo "Adding $DIR to dir_whitelist"
|
|
||||||
jq ".webui.dir_whitelist += [\"$DIR\"]" "$CONFIG_FILE" | sponge "$CONFIG_FILE"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user