Skip to content

Commit

Permalink
wifi script cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
anzz1 committed May 24, 2023
1 parent 512cf94 commit 448d759
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions extras/Tools/WiFi.pak/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ if [ -f "$USERDATA_PATH/.wifi/wifi_on.txt" ]; then
fi
fi

_WIFI_ON=$WIFI_ON
while :; do
if [ ! -f /appconfigs/wpa_supplicant.conf ]; then
show ./wifi2.png
say "WiFi: Not configured"$'\n'$'\n'"Please configure your WiFi network"$'\n'"by pressing SELECT."
else
show ./wifi.png
if [ $WIFI_ON == 1 ]; then
if [ $WIFI_ON -eq 1 ]; then
say "WiFi: Enabled"
else
say "WiFi: Disabled"
Expand All @@ -39,22 +40,18 @@ while :; do
if [ $KEY -eq 57 ]; then # 57 = A
if [ -f /appconfigs/wpa_supplicant.conf ]; then
WIFI_ON=$(( ! WIFI_ON ))
if [ $WIFI_ON -eq 1 ] && [ $_WIFI_ON -eq 0 ]; then
_WIFI_ON=1
LD_PRELOAD= ./wifion.sh > /dev/null 2>&1 &
fi
break
fi
elif [ $KEY -eq 97 ]; then # 97 = SELECT
./wifisetup.sh
break
elif [ $KEY -eq 29 ]; then # 29 = B
if [ -f /appconfigs/wpa_supplicant.conf ]; then
if [ -f "$USERDATA_PATH/.wifi/wifi_on.txt" ]; then
if [ $WIFI_ON == 0 ]; then
LD_PRELOAD= ./wifioff.sh > /dev/null 2>&1 &
fi
else
if [ $WIFI_ON == 1 ]; then
LD_PRELOAD= ./wifion.sh > /dev/null 2>&1 &
fi
fi
if [ $WIFI_ON -eq 0 ] && [ $_WIFI_ON -eq 1 ]; then
LD_PRELOAD= ./wifioff.sh > /dev/null 2>&1 &
fi
exit 0
fi
Expand Down

0 comments on commit 448d759

Please sign in to comment.