Grabbing connection and link status with nmcli



I've not used nmcli in any of its more intricate ways, but are there some
easily-parsed commands which will allow me to tell whether an Ethernet
interface is up (a la 'nmcli conn up/down') AND the cable is connected
('link/carrier state')?
I can grab some hints of the latter with /sys/class/net/eth0/carrier, but
would prefer an approach that is harmonised through nmcli. Are there a
couple of sub-commands that can be used rather than parsing the full 'nmcli
dev show' output? e.g. to output a couple of specific fields.

Thanks




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]