mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 01:22:25 +00:00
mac80211: automatically restart wifi if bringup failed
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -1162,10 +1162,13 @@ drv_mac80211_setup() {
|
||||
if [ "$no_reload" != "0" ]; then
|
||||
add_ap=1
|
||||
ubus wait_for hostapd
|
||||
local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
|
||||
local hostapd_res
|
||||
[ -f /tmp/wifi_fail_test ] || hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
|
||||
ret="$?"
|
||||
rm -f /tmp/wifi_fail_test
|
||||
[ "$ret" != 0 -o -z "$hostapd_res" ] && {
|
||||
wireless_setup_failed HOSTAPD_START_FAILED
|
||||
logger failed to start wifi trying again
|
||||
# wireless_setup_failed HOSTAPD_START_FAILED
|
||||
return
|
||||
}
|
||||
wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
|
||||
|
||||
@@ -1162,10 +1162,13 @@ drv_mac80211_setup() {
|
||||
if [ "$no_reload" != "0" ]; then
|
||||
add_ap=1
|
||||
ubus wait_for hostapd
|
||||
local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
|
||||
local hostapd_res
|
||||
[ -f /tmp/wifi_fail_test ] || hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
|
||||
ret="$?"
|
||||
rm -f /tmp/wifi_fail_test
|
||||
[ "$ret" != 0 -o -z "$hostapd_res" ] && {
|
||||
wireless_setup_failed HOSTAPD_START_FAILED
|
||||
logger failed to start wifi trying again
|
||||
# wireless_setup_failed HOSTAPD_START_FAILED
|
||||
return
|
||||
}
|
||||
wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
|
||||
|
||||
Reference in New Issue
Block a user