Skip to content

Commit

Permalink
wifi-ssid script added, issue iiitl#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Karanagarwal12 committed Mar 16, 2024
1 parent 96850b2 commit 17d94db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/wifi-ssid
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 17d94db

Please sign in to comment.