When searching through wifi-ifaces for specific modes, the mode string must be compared as a full word. So, add spaces around the searched name.
Else, adding a future new mode like "newap" or "apdetector" which embed an existing "ap" mode string, will end in detecting the wrong interface. This was found while trying to create a new detection service for WIDS. Signed-off-by: Jean-Pierre Tosoni <jp.tos...@acksys.fr> --- scripts/netifd-wireless.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh index 80fbf75..9dd5431 100644 --- a/scripts/netifd-wireless.sh +++ b/scripts/netifd-wireless.sh @@ -321,7 +321,7 @@ for_each_interface() { json_get_var _w_type mode json_select .. _w_types=" $_w_types " - [[ "${_w_types%$_w_type*}" = "$_w_types" ]] && { + [[ "${_w_types% $_w_type *}" = "$_w_types" ]] && { json_select .. continue } -- 2.17.1 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel