More Networking Things
Our Raspbian specific networking stuff is here: https://raspberry-projects.com/pi/category/pi-operating-systems/raspbian/network-settings
Is A Specific Interface Connected
ip link show wlan0
List discovered networks
sudo iwlist wlan0 scan
Is network connected
If the inet addr field has an address beside it, the RPi has connected to the network.
Get connected network SSID
iwgetid wlan0 -r
Will return just the SSID, or blank if not connected.