From bb377470658fa72c5c6cfd2f1c7e19d08f8d2a28 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 9 Sep 2011 23:29:06 +0300 Subject: [PATCH] fixed json output --- func/ip_func.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/func/ip_func.sh b/func/ip_func.sh index a368094eb..e98d475f6 100644 --- a/func/ip_func.sh +++ b/func/ip_func.sh @@ -475,6 +475,12 @@ ip_user_json_list() { # Print data for field in $fields; do eval value=$field + + # There is outpup + if [ ! -z "$value" ]; then + tpt='yes' + fi + # Checking parrent key if [ "$j" -eq 1 ]; then echo -e "\t\"$value\": {" @@ -492,7 +498,7 @@ ip_user_json_list() { done # If there was any output - if [ -n "$value" ]; then + if [ -n "$tpt" ]; then echo -e "\t}" fi