commit 6acf353c9dc31970986f641519cf9ce005a6be3c parent ed7d3f36f936862da3f511288cec83b163af48a2 Author: oblique <psyberbits@gmail.com> Date: Sun, 3 Aug 2014 14:45:27 +0300 networkmanager_is_running: Use 'nmcli g' first and if it fails fallback to 'nmcli nm' Diffstat:
M | create_ap | | | 4 | +++- |
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/create_ap b/create_ap @@ -82,7 +82,9 @@ NETWORKMANAGER_CONF=/etc/NetworkManager/NetworkManager.conf networkmanager_is_running() { which nmcli > /dev/null 2>&1 || return 1 - nmcli nm | grep -E '^running' > /dev/null 2>&1 + NMCLI_OUT=$(nmcli -t -f RUNNING g 2> /dev/null) + [[ $? -ne 0 ]] && NMCLI_OUT=$(nmcli -t -f RUNNING nm 2> /dev/null) + echo $NMCLI_OUT | grep -E '^running' > /dev/null 2>&1 } networkmanager_iface_is_unmanaged() {