I don't want to check if it has Internet connectivity! I just want to check if it's connected to the WiFi network (I'd have already given its SSID in the WPA_supplicant file).. This network won't have Internet access.
t="$(ifconfig wlan0 | awk '/inet addr/{print substr($2,6)}')"
echo $t
w=${#t}
echo $w
i run this code output comes 0.
if i am running simple is command
t="$(ifconfig wlan0 | awk '/inet addr/{print substr($2,6)}')" echo $t w=${#t} echo $w
output comes like w=0 echo
Check status if Raspberry Pi is connected to any WiFi network (Not Internet necessarily) using Python