mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 21:26:36 +00:00
/etc/init.d/S33hostapd: initialize all available ap interfaces
This commit is contained in:
parent
c1184428d8
commit
e95375e5ce
@ -37,20 +37,17 @@ watch() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_ap_iface() {
|
prepare_ap_ifaces() {
|
||||||
# Only prepare AP interfaces of format "apX"
|
wifi_ifaces=$(ip link | grep -oE 'wlan[[:digit:]]')
|
||||||
if ! [[ "${OS_AP}" =~ ap([[:digit:]]) ]]; then
|
msg_begin "Preparing AP interfaces"
|
||||||
return
|
ap_ifaces=""
|
||||||
|
for iface in ${wifi_ifaces}; do
|
||||||
|
ap_iface=ap${iface: -1}
|
||||||
|
if iw dev ${iface} interface add ${ap_iface} type __ap &>/dev/null; then
|
||||||
|
ap_ifaces+="${ap_iface} "
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
wlan_iface=wlan${BASH_REMATCH[1]}
|
msg_done "${ap_ifaces:-none}"
|
||||||
if ! iw dev ${wlan_iface} info &>/dev/null; then
|
|
||||||
return # No wlan interface
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_begin "Preparing AP interface"
|
|
||||||
iw dev ${wlan_iface} interface add ${OS_AP} type __ap &>/dev/null
|
|
||||||
test $? == 0 && msg_done || msg_fail
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start_hostapd() {
|
start_hostapd() {
|
||||||
@ -88,7 +85,7 @@ stop_hostapd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
prepare_ap_iface
|
prepare_ap_ifaces
|
||||||
|
|
||||||
if [[ -s ${CONF} ]]; then
|
if [[ -s ${CONF} ]]; then
|
||||||
start_hostapd
|
start_hostapd
|
||||||
|
@ -1 +0,0 @@
|
|||||||
OS_AP="ap0"
|
|
@ -1 +0,0 @@
|
|||||||
OS_AP="ap0"
|
|
@ -1 +0,0 @@
|
|||||||
OS_AP="ap0"
|
|
@ -1 +0,0 @@
|
|||||||
OS_AP="ap0"
|
|
Loading…
x
Reference in New Issue
Block a user