#!/bin/shstart=2000end=7000if [ $# -ne 1 ]then echo "You need to specify the interface \"$0 <iface>\"" exit 1fiif [ x"`which id 2> /dev/null`" != "x" ]then USERID="`id -u 2> /dev/null`"fiif [ x$USERID = "x" -a x$UID != "x" ]then USERID=$UIDfiif [ x$USERID != "x" -a x$USERID != "x0" ]then echo Run it as root ; exit ;fiinterface=$1if [ x"`iwconfig "$interface" 2>/dev/null`" = "x" ]then echo "There is no wireless interface \"$interface\"." exit 1fii=$startecho "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