#! /bin/bash # network.sh # Returns the SSID of the currently active # wireless network, if run on OS X. # Certain other scripts here rely on this one. ssid="" ssid=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/\ Current/Resources/airport -I | sed 's/^ *//g' | awk -F ': ' \ '$1 == "SSID" {print $2}'` echo $ssid