summaryrefslogtreecommitdiff
path: root/bin
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2016-02-10 12:14:21 +0100
committerSylvain Pineau <sylvain.pineau@canonical.com>2016-02-10 12:14:21 +0100
commit77c446c47c5c62a28f2113c6a4368248b50f66d8 (patch)
treea229adc8738e54dac635a5ed0cd1a19a36626683 /bin
parent34b5651413a6383a1cc7f936497c3c2914b0ce7b (diff)
providers:checkbox:bin:connect_wireless: Fix nmcli disconnect command
Network Manager API changes since 15.04, the disconnect method does not accept the iface parameter but the name of the interface directly. Fixes: https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1527154
Diffstat (limited to 'bin')
-rwxr-xr-xbin/connect_wireless6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/connect_wireless b/bin/connect_wireless
index c1ee36c..e39f52c 100755
--- a/bin/connect_wireless
+++ b/bin/connect_wireless
@@ -56,7 +56,11 @@ then
# Disconnect, pause for a short time
for iface in `(nmcli -f GENERAL dev list 2>/dev/null || nmcli -f GENERAL dev show) | grep 'GENERAL.DEVICE' | awk '{print $2}'`
do
- nmcli dev disconnect iface $iface
+ if [ $NMCLI_GTE_0_9_10 -eq 0 ]; then
+ nmcli dev disconnect iface $iface
+ else
+ nmcli dev disconnect $iface
+ fi
done
sleep 2
fi