From f5e06c43054b163e9da6e4dbbec5993d3094d335 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 11 Sep 2011 01:46:47 +0300 Subject: [PATCH] fixed json output --- func/shared_func.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/func/shared_func.sh b/func/shared_func.sh index 8257d46b8..7ca7b565c 100644 --- a/func/shared_func.sh +++ b/func/shared_func.sh @@ -1020,6 +1020,11 @@ v_json_list() { for field in $fields; do eval value=$field + # Checking if value exists + if [ ! -z "$value" ]; then + tpt=yes + fi + # Checking parrent key if [ "$j" -eq 1 ]; then echo -e "\t\"$value\": {" @@ -1037,7 +1042,7 @@ v_json_list() { done < $conf # If there was any output - if [ -n "$value" ]; then + if [ -n "$tpt" ]; then echo -e "\t}" fi