diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2015-06-02 10:22:55 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2015-06-02 10:22:55 +0200 |
commit | e0405b10b3bd07f83c09847450e895baa30ffe4f (patch) | |
tree | 123a7ed3e9ed9c9cb14edff1d976e19d97b3da94 /bin | |
parent | 11aa8b6cc0682a8579229057fab671acf41919e6 (diff) |
providers:checkbox:bin:network_wait: Fix nmcli calls to comply with NM >= 0.9.10
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/network_wait | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/network_wait b/bin/network_wait index 34e31fe..f0637d0 100755 --- a/bin/network_wait +++ b/bin/network_wait @@ -1,10 +1,15 @@ #!/bin/bash -set -e - x=1 while true; do - state=$(/usr/bin/nmcli -t -f STATE nm) + state=$(/usr/bin/nmcli -t -f STATE nm 2>/dev/null) + if [[ $? != 0 ]]; then + state=$(/usr/bin/nmcli -t -f STATE general 2>/dev/null) + rc=$? + if [[ $rc != 0 ]]; then + exit $rc + fi + fi if [ "$state" = "connected" ]; then echo $state exit 0 |