Skip to content

Commit 656652e

Browse files
committed
fixed incorrect reference
1 parent 49d6e17 commit 656652e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/hotspot.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff 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"
@@ -110,8 +110,7 @@ do
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"
@@ -127,8 +126,7 @@ do
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"
@@ -143,8 +141,7 @@ do
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

0 commit comments

Comments
 (0)