File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments