9 lines
234 B
Bash
Executable file
9 lines
234 B
Bash
Executable file
#!/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 "{}" }'
|