added fix for json parsing failing on 2 NR5G bands

This commit is contained in:
dr-dolomite
2024-03-17 21:16:24 +08:00
parent 80b34719a5
commit d8c1799789

View File

@@ -19,6 +19,13 @@ while IFS='=' read -r key value || [[ -n "$key" ]]; do
key=$(echo "$key" | awk '{$1=$1};1')
value=$(echo "$value" | awk '{$1=$1};1')
# Check if value includes double quotes inside it like: "value,"value"". If there is, remove the inner double quotes.
if [[ "$value" == *\"* ]]; then
value=$(echo "$value" | sed 's/\"//g')
# enclose the value in double quotes again
value="\"$value\""
fi
# Print key-value pair in JSON format without surrounding double quotes on value
printf ' "%s" : %s' "$key" "$value"