From b6c840e50090e9440f0930120beb08deb8bf4ff4 Mon Sep 17 00:00:00 2001 From: satyajit1206 <143374984+satyajit1206@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:34:40 +0530 Subject: [PATCH] Solved issue #1 I have written a simple Bash script that can be used on a macOS system to extract the SSID (Wi-Fi username) of the currently connected Wi-Fi network. This script utilises the airport utility that is included with macOS but is located within a framework, so its path is a bit lengthy. --- scripts/wifi-ssid | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/wifi-ssid b/scripts/wifi-ssid index 29af3cc..ac93536 100755 --- a/scripts/wifi-ssid +++ b/scripts/wifi-ssid @@ -2,3 +2,6 @@ # Extract the wifi username (SSID) # Refer: "iw dev wlan0 link" command output for this +SSID=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID:/ {print substr($0, index($0, $2))}') + +echo "Currently connected Wi-Fi SSID: $SSID"