From 6e5528727ef0c50f477a3a1d9e2f7a03b3f97c88 Mon Sep 17 00:00:00 2001 From: Scott Severance Date: Fri, 4 Nov 2016 20:10:55 -0500 Subject: [PATCH] Altered bin/ssid to make it also work under Ubuntu --- bin/ssid | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/ssid b/bin/ssid index f6dd383b4f..eea0ce9973 100755 --- a/bin/ssid +++ b/bin/ssid @@ -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