#!/bin/sh # Petr Simandl www.simandl.cz # listing of all possible channels of given wifi card # License : GPL version="0.0.2" chmin=1 chmax=240 if [ "$1 x" = " x" ] then echo "Missing interface name" echo "Usage: $0 " exit 1 else iface=$1 fi a_lch() { for channel in `seq $chmin $chmax` do iwconfig $iface channel $channel 2>/dev/null && ( echo -n " Channel " ; echo -n "$channel : " ; \ iwlist $iface freq 2>/dev/null | grep Freq | sed 's/Current Frequency://' | sed 's/GHz//' | awk '{print $1" GHz"}' ) done } for mode in `seq 0 3` do echo "mode : $mode" iwpriv $iface mode $mode > /dev/null a_lch done exit 0