mac80211: improve wifi interface cleanup
authorFelix Fietkau <nbd@openwrt.org>
Sat, 23 Jan 2010 08:28:20 +0000 (08:28 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 23 Jan 2010 08:28:20 +0000 (08:28 +0000)
SVN-Revision: 19285

package/mac80211/files/lib/wifi/mac80211.sh

index cd03b3082c2f4bbf03436e1d4cf7f9d823ec8868..1c12a154c58801fb15d07b09c6b62fcf347f2b79 100644 (file)
@@ -174,12 +174,13 @@ disable_mac80211() (
        # kill all running hostapd and wpa_supplicant processes that
        # are running on atheros/mac80211 vifs
        for pid in `pidof hostapd wpa_supplicant`; do
-               grep "$phy" /proc/$pid/cmdline >/dev/null && \
+               grep -E "($phy|wlan)" /proc/$pid/cmdline >/dev/null && \
                        kill $pid
        done
 
        include /lib/network
        for wdev in $(ls /sys/class/ieee80211/${phy}/device/net 2>/dev/null); do
+               [ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) >&/dev/null 2>&1
                ifconfig "$wdev" down 2>/dev/null
                unbridge "$dev"
                iw dev "$wdev" del