fixed json output

This commit is contained in:
Serghey Rodin 2011-09-09 23:29:06 +03:00
commit bb37747065

View file

@ -475,6 +475,12 @@ ip_user_json_list() {
# Print data # Print data
for field in $fields; do for field in $fields; do
eval value=$field eval value=$field
# There is outpup
if [ ! -z "$value" ]; then
tpt='yes'
fi
# Checking parrent key # Checking parrent key
if [ "$j" -eq 1 ]; then if [ "$j" -eq 1 ]; then
echo -e "\t\"$value\": {" echo -e "\t\"$value\": {"
@ -492,7 +498,7 @@ ip_user_json_list() {
done done
# If there was any output # If there was any output
if [ -n "$value" ]; then if [ -n "$tpt" ]; then
echo -e "\t}" echo -e "\t}"
fi fi