summaryrefslogtreecommitdiff
path: root/package/base-files/src/etc/network/if-post-down.d/03-wireless
blob: 67c01714e442cb61920f24424bd70235eb0331fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -x
set -e 

[ "${IFACE%%[0-9]*}" = "wlan" ] || exit 0

case "$IF_WIRELESS_MODE" in
	ap)
		logger -t hostap "Killing hostapd"
		pkill hostapd
		;;
	sta)
		[ "$IF_WIRELESS_SECURITY" != "none" ] && {
			logger -t wireless "Killing wpa_supplicant"
			kill -9 $(cat /var/run/wpa_supplicant.pid)
		}
		;;
	*)
		exit 0
		;;
esac
exit 0