I am writing a script on 16.04; to show connection identification, especially for VPN connections, by listing active connections with
ip -o link sh up | awk 'BEGIN{FS=": "} $2!="lo" {print $2}'
and getting:
enp0s25
ppp0
Now I want to get/return the Connection NAME, the same as from:
#: nmcli con sh --active
NAME UUID TYPE DEVICE
VPN-pptp-01 22222222-2222-f48f-99d0-817335722def vpn enp0s25
enp0s25 11111111-1111-43c9-9577-112ae6f11abc 802-3-ethernet enp0s25
using the previously return active device ID, especially for ppp0 (from above)
How can this be done using nmcli or perhaps D-Bus?