Skip to content

Commit c3b5d2a

Browse files
Merge pull request #332 from jakereps/patch-1
fix(nextwork): airport response is multi-line if wifi disabled
2 parents 1e7b7cc + ab6fcb7 commit c3b5d2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ get_ssid()
2525

2626
Darwin)
2727
local wifi_network=$(ipconfig getsummary en0 | awk -F ' SSID : ' '/ SSID : / {print $2}')
28-
local airport=$(networksetup -getairportnetwork en0 | cut -d ':' -f 2)
28+
local airport=$(networksetup -getairportnetwork en0 | cut -d ':' -f 2 | head -n 1)
2929

3030
if [[ $airport != "You are not associated with an AirPort network." ]]; then
3131
echo "$wifi_label$airport" | sed 's/^[[:blank:]]*//g'

0 commit comments

Comments
 (0)