Comment 8 for bug 1564808

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

From the output of the nmcli command (omitting the cut part), it's:
GENERAL:ttyACM3:gsm:NMDeviceModem:Telit:6 CDC-ACM + 1 CDC-ECM:cdc_acm, cdc_ether:::(unknown):0:100 (connected):0 (No reason given):/org/freedesktop/ModemManager1/Modem/0:ppp0:no:yes:yes:no:--:test connection:74298ac0-52c7-4b28-a6ad-ea4d77f160af:/org/freedesktop/NetworkManager/ActiveConnection/11

If we're cutting this string with ":" as delimiter, the 13th field will be the "0 (No reason given)", since we're looking for the interface, the second field will be the correct one: "ttyACM3"

As a result, changing the command a little bit might help:
INTERFACE=`(nmcli -t -f GENERAL -m tabular dev list 2>/dev/null || nmcli -t -f GENERAL -m tabular dev show) |grep gsm |cut -d ":" -f 2`

I wonder why this bug is hitting now, verified with a Precise SRU system it's also affected. Maybe it has something to do with some changes in nmcli.