commit 2491ef2a3a867b9455861602421321e90cf88175
parent 6acf353c9dc31970986f641519cf9ce005a6be3c
Author: oblique <psyberbits@gmail.com>
Date: Mon, 4 Aug 2014 10:11:01 +0300
Better parse of nmcli output
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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() {