Skip to content

Commit bb37747

Browse files
committed
fixed json output
1 parent 3bf357b commit bb37747

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

func/ip_func.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,12 @@ ip_user_json_list() {
475475
# Print data
476476
for field in $fields; do
477477
eval value=$field
478+
479+
# There is outpup
480+
if [ ! -z "$value" ]; then
481+
tpt='yes'
482+
fi
483+
478484
# Checking parrent key
479485
if [ "$j" -eq 1 ]; then
480486
echo -e "\t\"$value\": {"
@@ -492,7 +498,7 @@ ip_user_json_list() {
492498
done
493499

494500
# If there was any output
495-
if [ -n "$value" ]; then
501+
if [ -n "$tpt" ]; then
496502
echo -e "\t}"
497503
fi
498504

0 commit comments

Comments
 (0)