Skip to content

Commit dcae876

Browse files
authored
fix wlan toggles (#74)
1 parent ea27902 commit dcae876

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

package/pixelpilot/files/gsmenu.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,22 @@ EOF
843843
sed -i "s/^PIXELPILOT_VIDEO_SCALE=.*/PIXELPILOT_VIDEO_SCALE=$5/" /etc/default/pixelpilot
844844
;;
845845
"get gs wifi hotspot")
846-
[ -f /etc/wpa_supplicant.hotspot.conf ] && echo 1 || echo 0
846+
# Check if hotspot config exists AND wlan0 is up with an IP
847+
if [ -f /etc/wpa_supplicant.hotspot.conf ] && ip addr show wlan0 2>/dev/null | grep -q "inet "; then
848+
echo 1
849+
else
850+
echo 0
851+
fi
847852
;;
848853
"get gs wifi wlan")
849-
[ -f /etc/network/interfaces.d/wlan0 -a ! -f /etc/wpa_supplicant.hotspot.conf ] && echo 1 || echo 0
854+
# Check if wlan0 config exists AND wlan0 is up with an IP (and not hotspot mode)
855+
if [ -f /etc/network/interfaces.d/wlan0 ] && \
856+
[ ! -f /etc/wpa_supplicant.hotspot.conf ] && \
857+
ip addr show wlan0 2>/dev/null | grep -q "inet "; then
858+
echo 1
859+
else
860+
echo 0
861+
fi
850862
;;
851863
"get gs wifi ssid")
852864
if [ -f /etc/wpa_supplicant.conf ]; then

0 commit comments

Comments
 (0)