Don't read from file when creating hotspot
This commit is contained in:
parent
9017806ec2
commit
e5da5f89cf
|
@ -165,34 +165,36 @@ if [ ${WIFI_DISABLE} ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${WIFI_NETWORKS_FILE} ]; then
|
if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
|
||||||
wifi_established=
|
if [ -f ${WIFI_NETWORKS_FILE} ]; then
|
||||||
wifi_retry_ctr=0
|
wifi_established=
|
||||||
while [ ! $wifi_established ]; do
|
wifi_retry_ctr=0
|
||||||
if [ ${wifi_retry_ctr} -gt 0 ]; then
|
while [ ! $wifi_established ]; do
|
||||||
wpa_action ${WIFI_INTERFACE} stop
|
if [ ${wifi_retry_ctr} -gt 0 ]; then
|
||||||
wpa_cli -i ${WIFI_INTERFACE} terminate
|
wpa_action ${WIFI_INTERFACE} stop
|
||||||
|
wpa_cli -i ${WIFI_INTERFACE} terminate
|
||||||
|
fi
|
||||||
|
networks_from_file
|
||||||
|
# allow some time for a connection to be established
|
||||||
|
sleep 5
|
||||||
|
# has it worked?
|
||||||
|
if [[ $(wifi_is_running) != "0" ]]; then
|
||||||
|
wifi_established=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# has the limit of retries been reached?
|
||||||
|
wifi_retry_ctr=$((wifi_retry_ctr+1))
|
||||||
|
if [ ${wifi_retry_ctr} -ge ${WIFI_MAX_RETRIES} ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ $wifi_established ]; then
|
||||||
|
wpa_cli status
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo $'Wifi could not be started'
|
||||||
|
exit 4
|
||||||
fi
|
fi
|
||||||
networks_from_file
|
|
||||||
# allow some time for a connection to be established
|
|
||||||
sleep 5
|
|
||||||
# has it worked?
|
|
||||||
if [[ $(wifi_is_running) != "0" ]]; then
|
|
||||||
wifi_established=1
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
# has the limit of retries been reached?
|
|
||||||
wifi_retry_ctr=$((wifi_retry_ctr+1))
|
|
||||||
if [ ${wifi_retry_ctr} -ge ${WIFI_MAX_RETRIES} ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ $wifi_established ]; then
|
|
||||||
wpa_cli status
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo $'Wifi could not be started'
|
|
||||||
exit 4
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue