#!/bin/sh

# Set up appropriate wireless configuration based on location

tmp=/tmp/iwscan.$$

iwlist eth0 scanning | grep ESSID > $tmp

cd /etc/wireless
for ESSID in * ; do
	if grep -q "\"$ESSID\"" $tmp; then
		export ESSID
		/sbin/ifup "/etc/wireless/$ESSID"
	fi
done
