#!/bin/bash school="MU_Unplugged" iface="$1" if [ -z "$iface" ] ; then echo "Usage: $0 IFACE" exit 1 fi ifconfig "$iface" > /dev/null 2>&1 || (echo "$iface is not connected...not bringing up" && exit 1) iwconfig "$iface" mode managed > /dev/null; iwconfig "$iface" essid any > /dev/null; sleep 1 if iwconfig "$iface" | grep "ESSID:\"$school\"" > /dev/null then echo $iface-school else echo $iface-home fi