#!/bin/bash

DEVS=`ip link|grep "state UP"|awk '{print $2}'|cut -d ":" -f 1|grep "^bond[0-9]$\|^eth[0-9]$"`
POSITION=1
echo "{"
echo " \"data\":["
for DEV in $DEVS
do
    if [ $POSITION -gt 1 ]
    then
        echo ","
    fi
    echo -n " { \"{#IFNAME}\": \"$DEV\"}"
    POSITION=$[POSITION+1]
done
echo ""
echo " ]"
echo "}"
