From 235ff251a773a8530277bb2e4992334990183c72 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 2 Oct 2016 15:37:35 +0100 Subject: [PATCH] Detect wlan in descending order This assumes that there might be the default proprietary wlan on a low number and an Atheros dongle on a higher number --- src/freedombone-mesh-batman | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/freedombone-mesh-batman b/src/freedombone-mesh-batman index b101702c..e5d7de3e 100755 --- a/src/freedombone-mesh-batman +++ b/src/freedombone-mesh-batman @@ -72,8 +72,18 @@ IFACE='wlan0' EIFACE=eth0 if [[ $IFACE == "wlan0" ]]; then - if grep -q "wlan1" /proc/net/dev; then - IFACE=wlan1 + if grep -q "wlan5" /proc/net/dev; then + IFACE=wlan5 + fi +fi +if [[ $IFACE == "wlan0" ]]; then + if grep -q "wlan4" /proc/net/dev; then + IFACE=wlan4 + fi +fi +if [[ $IFACE == "wlan0" ]]; then + if grep -q "wlan3" /proc/net/dev; then + IFACE=wlan3 fi fi if [[ $IFACE == "wlan0" ]]; then @@ -82,8 +92,8 @@ if [[ $IFACE == "wlan0" ]]; then fi fi if [[ $IFACE == "wlan0" ]]; then - if grep -q "wlan3" /proc/net/dev; then - IFACE=wlan3 + if grep -q "wlan1" /proc/net/dev; then + IFACE=wlan1 fi fi