summaryrefslogtreecommitdiff
path: root/package/madwifi
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-10-29 17:26:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-10-29 17:26:49 +0000
commita4f11ca22e6f69d2feab4f239eb84d35f7cbe555 (patch)
tree6816cc5e005ec5573100c83da92a5cd0783468a3 /package/madwifi
parent9161a7023556a0db76e3d56fde12bc8b3c30a3e1 (diff)
downloadmtk-20170518-a4f11ca22e6f69d2feab4f239eb84d35f7cbe555.zip
mtk-20170518-a4f11ca22e6f69d2feab4f239eb84d35f7cbe555.tar.gz
mtk-20170518-a4f11ca22e6f69d2feab4f239eb84d35f7cbe555.tar.bz2
use pidfiles for hostapd/wpa_supplicant instead of killing all processes when bringing an interface down - fixes an issue with random hostapd death
SVN-Revision: 13078
Diffstat (limited to 'package/madwifi')
-rwxr-xr-xpackage/madwifi/files/lib/wifi/madwifi.sh10
1 files changed, 3 insertions, 7 deletions
diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh
index 6ee6435..5ce288f 100755
--- a/package/madwifi/files/lib/wifi/madwifi.sh
+++ b/package/madwifi/files/lib/wifi/madwifi.sh
@@ -50,18 +50,14 @@ disable_atheros() (
local device="$1"
set_wifi_down "$device"
- # kill all running hostapd and wpa_supplicant processes that
- # are running on atheros vifs
- for pid in `pidof hostapd wpa_supplicant`; do
- grep ath /proc/$pid/cmdline >/dev/null && \
- kill $pid
- done
include /lib/network
cd /proc/sys/net
for dev in *; do
grep "$device" "$dev/%parent" >/dev/null 2>/dev/null && {
- ifconfig "$dev" down
+ [ -f "/var/run/wifi-${dev}.pid" ] &&
+ kill "$(cat "/var/run/wifi-${dev}.pid")"
+ ifconfig "$dev" down
unbridge "$dev"
wlanconfig "$dev" destroy
}