6 if [ -z "$NETWORK" ]; then
10 if [ -z "$WIRELESS" ]; then
14 # First try a minor cycle
16 ESSID=$(/sbin/iwconfig "$WIRELESS" 2>/dev/null |grep ESSID |perl -ne 'm/\"([^\"]+)\"/ && print $1,qq(\n)')
18 if [ -n "$ESSID" ]; then
19 sudo iwconfig "$WIRELESS" essid "$ESSID"
21 if /sbin/iwconfig "$WIRELESS" 2>/dev/null | grep 'Bit Rate'|grep -qv '=1 Mb/s'; then
26 # Failure, so major cycle
28 if [ "$WIRELESS" == "wireless" ]; then
29 sudo modprobe -r bcm43xx;
30 sudo modprobe bcm43xx;
32 sudo ifup "wireless=${NETWORK}";