From df75ea2a464788d87c4460b982793c9a300adbea Mon Sep 17 00:00:00 2001 From: Pratyush Nalam Date: Mon, 8 Apr 2024 14:20:55 +0530 Subject: [PATCH] Modify how network name is parsed for Mac because airport command is deprecated in 14.4+ --- scripts/network.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/network.sh b/scripts/network.sh index 27c5514..883212e 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -18,8 +18,8 @@ get_ssid() ;; Darwin) - if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2 | sed 's/^[[:blank:]]*//g' &> /dev/null; then - echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)" | sed 's/^[[:blank:]]*//g' + if networksetup -getairportnetwork en0 | cut -d ':' -f 2 | sed 's/^[[:blank:]]*//g' &> /dev/null; then + echo "$(networksetup -getairportnetwork en0 | cut -d ':' -f 2)" | sed 's/^[[:blank:]]*//g' else echo 'Ethernet' fi