From 612530725e416b198f1f43ef12daa40777825d3b Mon Sep 17 00:00:00 2001 From: macmpi Date: Fri, 4 Nov 2016 22:05:14 +0100 Subject: [PATCH 1/2] can_be_sta_and_ap() regexp fix Proposed fix for proper multiple SSID support detection. Please refer to issue #203 https://github.com/oblique/create_ap/issues/203 Did test the regex part on several iw list dumps from few wlan adapters (including Raspi3). --- create_ap | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/create_ap b/create_ap index b0b7751..976a33a 100755 --- a/create_ap +++ b/create_ap @@ -279,8 +279,7 @@ get_adapter_kernel_module() { can_be_sta_and_ap() { # iwconfig does not provide this information, assume false [[ $USE_IWCONFIG -eq 1 ]] && return 1 - get_adapter_info "$1" | grep -E '{.* managed.* AP.*}' > /dev/null 2>&1 && return 0 - get_adapter_info "$1" | grep -E '{.* AP.* managed.*}' > /dev/null 2>&1 && return 0 + get_adapter_info "$1" | sed -r 's/.*\{.* AP.*\} *<= *([0-9]*).*/\1/g' | sed -r 's/([0-9]*).*/\1/g' | awk '$1 > 1' > /dev/null 2>&1 && return 0 return 1 } From 948e4712572eb60e0b22ed4d8ea34ba389ed62fc Mon Sep 17 00:00:00 2001 From: macmpi Date: Sat, 5 Nov 2016 13:25:33 +0100 Subject: [PATCH 2/2] proper chaining with return code --- create_ap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_ap b/create_ap index 976a33a..fc479ef 100755 --- a/create_ap +++ b/create_ap @@ -279,7 +279,7 @@ get_adapter_kernel_module() { can_be_sta_and_ap() { # iwconfig does not provide this information, assume false [[ $USE_IWCONFIG -eq 1 ]] && return 1 - get_adapter_info "$1" | sed -r 's/.*\{.* AP.*\} *<= *([0-9]*).*/\1/g' | sed -r 's/([0-9]*).*/\1/g' | awk '$1 > 1' > /dev/null 2>&1 && return 0 + get_adapter_info "$1" | sed -r 's/.*\{.* AP.*\} *<= *([0-9]*).*/\1/g' | sed -r 's/([0-9]*).*/\1/g' | awk '$1 > 1' | grep -E '[0-9*]' > /dev/null 2>&1 && return 0 return 1 }