Skip to content

Commit

Permalink
Altered bin/ssid to make it also work under Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
mssever committed Nov 5, 2016
1 parent 95e21b8 commit 6e55287
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/ssid
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ otherwise echo nothing.
Copyright (c) 2012 "Cowboy" Ben Alman
Licensed under the MIT license.
http://benalman.com/about/license/
Altered by Scott Severance to work on Ubuntu, as well.
HELP
exit; fi

ssid=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | sed -En 's/^ +SSID: +//p')
if [[ -f '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport' ]]; then
ssid="$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | sed -En 's/^ +SSID: +//p')"
elif [[ iwconfig >/dev/null ]]; then
ssid="$(iwconfig 2>/dev/null | grep SSID | cut -d\" -f2)"
fi

if [ "$1" ]; then
if [ "$(echo $ssid | grep -w $1)" ]; then
Expand Down

0 comments on commit 6e55287

Please sign in to comment.