fix: macos ssid command

This commit is contained in:
Abhishek Keshri 2024-03-18 03:55:13 +05:30
parent 6c234a08fd
commit 0745a1bea8
No known key found for this signature in database

View file

@ -16,8 +16,8 @@ get_ssid() {
;; ;;
Darwin) Darwin)
if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2 | sed 's/ ^*//g' &>/dev/null; then SSID=$(networksetup -getairportnetwork en1 | awk -F ": " '{print $2}')
SSID="$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)" if [ -n "$SSID" ]; then
printf '%s' "$SSID" printf '%s' "$SSID"
else else
echo '󰈀 Ethernet' echo '󰈀 Ethernet'