From 2491ef2a3a867b9455861602421321e90cf88175 Mon Sep 17 00:00:00 2001 From: oblique Date: Mon, 4 Aug 2014 10:11:01 +0300 Subject: [PATCH] Better parse of nmcli output --- create_ap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_ap b/create_ap index fe58105..d32f03e 100755 --- a/create_ap +++ b/create_ap @@ -84,11 +84,11 @@ networkmanager_is_running() { which nmcli > /dev/null 2>&1 || return 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 + [[ "$NMCLI_OUT" == "running" ]] } networkmanager_iface_is_unmanaged() { - nmcli dev status | grep -E "$1.+unmanaged" > /dev/null 2>&1 + nmcli -t -f DEVICE,STATE d | grep -E "^$1:unmanaged$" > /dev/null 2>&1 } networkmanager_add_unmanaged() {