mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-04 00:01:36 +01:00
Allow multiple Address fields
This commit is contained in:
@@ -26,7 +26,15 @@ _parse_config() {
|
||||
if [[ "$line" =~ ^[[:space:]]*([^=[:space:]]+)[=[:space:]]+(.*)[[:space:]]* ]]; then
|
||||
local key="${BASH_REMATCH[1]}"
|
||||
local value="${BASH_REMATCH[2]}"
|
||||
config_ref["$key"]="$value"
|
||||
if [[ "$key" == "Address" ]]; then
|
||||
if [[ -n "${config_ref["Address"]:-}" ]]; then
|
||||
config_ref["Address"]+=",${value}"
|
||||
else
|
||||
config_ref["Address"]="${value}"
|
||||
fi
|
||||
else
|
||||
config_ref["$key"]="$value"
|
||||
fi
|
||||
fi
|
||||
done < "$config_file"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user