Skip to content

Commit 69a42ea

Browse files
committed
hotspot wip
1 parent c64c010 commit 69a42ea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/hotspot.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ ACTIVE_MODE=
8181

8282
while true;
8383
do
84-
if [[ ${ACTIVE_MODE} eq "ap" ]]; then
84+
if [[ ${ACTIVE_MODE} -eq "ap" ]]; then
8585
sleep 300
8686
if [[ areKnownNetworksNearBy ]]; then
8787
systemctl stop omnipy.service
88-
KillHotspot
88+
KillHotSpot
8989
echo "Hotspot Deactivated, Bringing Wifi Up"
9090
CreateWifiClient
9191
if [[ ! IsWifiConnected ]]; then
@@ -97,7 +97,7 @@ do
9797
fi
9898
systemctl start omnipy.service
9999
fi
100-
elif [[ ${ACTIVE_MODE} eq "client" ]]; then
100+
elif [[ ${ACTIVE_MODE} -eq "client" ]]; then
101101
sleep 60
102102
if [[ ! IsWifiConnected ]]; then
103103
systemctl stop omnipy.service
@@ -113,8 +113,10 @@ do
113113
systemctl start omnipy.service
114114
fi
115115
else
116-
if [[ areKnownNetworksNearBy ]]; then
117-
CreateWifiClient
116+
if [[ ! IsWifiConnected ]]; then
117+
if [[ areKnownNetworksNearBy ]]; then
118+
CreateWifiClient
119+
fi
118120
fi
119121

120122
if [[ ! IsWifiConnected ]]; then

0 commit comments

Comments
 (0)