From 3fe8513d9aa2a456bc56d5f2fc1a4576d655c35b Mon Sep 17 00:00:00 2001 From: oblique Date: Sat, 6 Sep 2014 20:33:33 +0300 Subject: [PATCH] Handle the case where `unmanaged-devices=' is empty Fix #45 --- create_ap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/create_ap b/create_ap index 8ee8d4d..da6c5aa 100755 --- a/create_ap +++ b/create_ap @@ -229,9 +229,10 @@ networkmanager_add_unmanaged() { [[ -z "$MAC" ]] && return 1 fi - UNMANAGED=$(grep -m1 -Eo '^unmanaged-devices=[[:alnum:]:;,-]*' /etc/NetworkManager/NetworkManager.conf | sed 's/unmanaged-devices=//' | tr ';,' ' ') + UNMANAGED=$(grep -m1 -Eo '^unmanaged-devices=[[:alnum:]:;,-]*' /etc/NetworkManager/NetworkManager.conf) WAS_EMPTY=0 [[ -z "$UNMANAGED" ]] && WAS_EMPTY=1 + UNMANAGED=$(echo "$UNMANAGED" | sed 's/unmanaged-devices=//' | tr ';,' ' ') for x in $UNMANAGED; do [[ $x == "mac:${MAC}" ]] && return 2