diff options
Diffstat (limited to 'package/network/services/hostapd/files/hostapd.hotplug')
-rw-r--r-- | package/network/services/hostapd/files/hostapd.hotplug | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/package/network/services/hostapd/files/hostapd.hotplug b/package/network/services/hostapd/files/hostapd.hotplug new file mode 100644 index 0000000000..d568b3c85a --- /dev/null +++ b/package/network/services/hostapd/files/hostapd.hotplug @@ -0,0 +1,14 @@ +#!/bin/sh + +[ ${ACTION} = "remove" -a -n "${DEVICENAME}" ] && { + kill $(cat /var/run/hostapd-${DEVICENAME}.pid) + rm -rf /var/run/hostapd-${DEVICENAME}.pid /var/run/hostapd-${DEVICENAME}/ + kill $(cat /var/run/wpa_supplicant-${DEVICENAME}.pid) + rm -rf /var/run/wpa_supplicant-${DEVICENAME}.pid /var/run/wpa_supplicant-${DEVICENAME}/ +} + +[ ${ACTION} = "add" -a -n "${DEVICENAME}" ] && { + /usr/sbin/hostapd -s -n ${DEVICENAME} -P /var/run/hostapd-${DEVICENAME}.pid -g /var/run/hostapd-${DEVICENAME}/global -B & + mkdir -p /var/run/wpa_supplicant-${DEVICENAME} + /usr/sbin/wpa_supplicant -s -n ${DEVICENAME} -P /var/run/wpa_supplicant-${DEVICENAME}.pid -g /var/run/wpa_supplicant-${DEVICENAME}/global -B & +} |