#!/bin/sh start=2000 end=7000 if [ $# -ne 1 ] then echo "You need to specify the interface \"$0 \"" exit 1 fi if [ x"`which id 2> /dev/null`" != "x" ] then USERID="`id -u 2> /dev/null`" fi if [ x$USERID = "x" -a x$UID != "x" ] then USERID=$UID fi if [ x$USERID != "x" -a x$USERID != "x0" ] then echo Run it as root ; exit ; fi interface=$1 if [ x"`iwconfig "$interface" 2>/dev/null`" = "x" ] then echo "There is no wireless interface \"$interface\"." exit 1 fi i=$start echo "Available frequencies:" while [ $i -le $end ] do if [ x"`iwconfig $interface freq "$i"M 2>&1`" = x ] then echo "$i - $(( (($i - 2412)/5)+1 ))" fi i=$(($i+1)) done