broadcom-wl: shutdown 'nas' when 'wl' device is disabled
[openwrt.git] / package / kernel / broadcom-wl / files / lib / wifi / broadcom.sh
index 80cd9d5f3d6229432124c6244d9fe997fbd33f60..191092af38fda24c82f3753c2708fde9a478f57f 100644 (file)
@@ -101,6 +101,9 @@ disable_broadcom() {
        (
                include /lib/network
 
+               local pid_file=/var/run/nas.$device.pid
+               [ -e $pid_file ] && start-stop-daemon -K -q -s SIGKILL -p $pid_file && rm $pid_file
+
                # make sure the interfaces are down and removed from all bridges
                for dev in $device ${device}-1 ${device}-2 ${device}-3; do
                        ifconfig "$dev" down 2>/dev/null >/dev/null && {
@@ -346,7 +349,6 @@ enable_broadcom() {
                }
                _c=$(($_c + 1))
        done
-       killall -KILL nas >&- 2>&-
        wlc ifname "$device" stdin <<EOF
 $ifdown