User Tools

Site Tools

Please note, that this is an old archived version of this site. Check out the new version at!

Make your Mac feel at Home

A small snippet from one of my scripts which tests whether your Mac is in the given (home) WLAN.

# Path to 'airport' executeable, as of Mac OS X 10.5.
# Set this to your Home WLAN SSID (name):
# Get SSID info from 'airport' and search for $HOMESSID
SSID=$(${AIRPORT} --getinfo | grep ' SSID:')
SSID=$(echo ${SSID} | grep "^SSID: ${HOMESSID}\$")
# Branch depending on grep's return code.
if [ "$?" == "0" ]; then
	# in home wlan
	echo "home sweet home..."
	# not at home
	echo "on the road again..."

To use this code, set the HOMESSID to your SSID (the name of the wireless network) and replace the two echo lines with your code.

info/mac/make_your_mac_feel_home.txt · Last modified: 2015-11-25 08:53 by andunix