hostap/tests/hwsim/stop-wifi.sh
Jouni Malinen 024913a156 tests: Stop valgrind.bin regardless of which option is started
The previous design of having to provide valgrind parameter to
stop-wifi.sh did not work since the new test setup may no match the
previous one. Instead of trying to figure out what needs to be stopped
based on previous run, stop all wpa_supplicant/hostapd processes running
under valgrind unconditionally to avoid cases where new set of processes
cannot be started due to existing processed.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-08-26 11:28:32 +03:00

18 lines
384 B
Bash
Executable file

#!/bin/sh
sudo killall -q hostapd
sudo killall -q wpa_supplicant
for i in `pidof valgrind.bin`; do
if ps $i | grep -q -E "wpa_supplicant|hostapd"; then
sudo kill $i
fi
done
sudo killall -q wlantest
sudo killall -q tcpdump
if grep -q hwsim0 /proc/net/dev; then
sudo ifconfig hwsim0 down
fi
if grep -q mac80211_hwsim /proc/modules ; then
sudo rmmod mac80211_hwsim
fi