Modify how network name is parsed for Mac because airport command is deprecated in 14.4+
This commit is contained in:
parent
787e9cded3
commit
df75ea2a46
1 changed files with 2 additions and 2 deletions
|
@ -18,8 +18,8 @@ get_ssid()
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Darwin)
|
Darwin)
|
||||||
if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2 | sed 's/^[[:blank:]]*//g' &> /dev/null; then
|
if networksetup -getairportnetwork en0 | 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'
|
echo "$(networksetup -getairportnetwork en0 | cut -d ':' -f 2)" | sed 's/^[[:blank:]]*//g'
|
||||||
else
|
else
|
||||||
echo 'Ethernet'
|
echo 'Ethernet'
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue