mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-26 22:29:33 +00:00
15 lines
699 B
Plaintext
15 lines
699 B
Plaintext
|
#!/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 &
|
||
|
}
|