File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ CreateHotSpot()
3434 systemctl start hostapd
3535}
3636
37- ConnectToWifi ()
37+ CreateWifiClient ()
3838{
3939 CleanUp
4040 echo " Starting WiFi connection"
110110 systemctl stop omnipy-beacon.service
111111 systemctl stop omnipy.service
112112 echo " Known networks are nearby, deactivating hotspot and connecting to wi-fi"
113- CreateWifiClient
114- if ! IsWifiConnected; then
113+ if ! CreateWifiClient; then
115114 echo " Failed to connect to wifi, going back into hotspot mode"
116115 CreateHotSpot
117116 ACTIVE_MODE=" ap"
127126 sleep 60
128127 if ! IsWifiConnected; then
129128 echo " Wi-fi disconnected, retrying"
130- CreateWifiClient
131- if ! IsWifiConnected; then
129+ if ! CreateWifiClient; then
132130 echo " No wi-fi connection, creating hot-spot"
133131 CreateHotSpot
134132 ACTIVE_MODE=" ap"
143141 elif [[ ${ACTIVE_MODE} == " client-only" ]]; then
144142 if ! IsWifiConnected; then
145143 echo " Wi-fi disconnected, retrying"
146- CreateWifiClient
147- if ! IsWifiConnected; then
144+ if ! CreateWifiClient; then
148145 echo " Wi-fi connection failed, waiting to retry"
149146 sleep 120
150147 fi
You can’t perform that action at this time.
0 commit comments