#!/usr/bin/env bash nmcli -t c show --active | awk -F ':' -e \ '// { if ($3 == "'$1'") { print "{\"name\":\""$1"\",\"device\":\""$4"\"}"; found = 1; exit; }} END { if (!found) print "{}" }'