diff --git a/scripts/wifi-ssid b/scripts/wifi-ssid index 29af3cc..01510bb 100755 --- a/scripts/wifi-ssid +++ b/scripts/wifi-ssid @@ -2,3 +2,12 @@ # Extract the wifi username (SSID) # Refer: "iw dev wlan0 link" command output for this + +ssid=$(iwgetid -r) + +# Check if the SSID is empty (i.e., not connected to Wi-Fi) +if [ -z "$ssid" ]; then + echo "Not connected to any Wi-Fi network." +else + echo "Connected Wi-Fi network SSID: $ssid" +fi \ No newline at end of file