Rev 27 |
|
Rev 28 |
Line 2... |
|
Line 2... |
# authors : Petr Simandl www.simandl.cz |
|
# authors : Petr Simandl www.simandl.cz |
# : Fyzik, Covex, Tydyt, Thunder.m |
|
# : Fyzik, Covex, Tydyt, Thunder.m |
# release date : 17/03/2006 |
|
# release date : 20/03/2006 |
# name : wifimon |
|
# name : wifimon |
# description : hostap and madwifi powered card monitoring |
|
# description : hostap and madwifi powered card monitoring |
# license : GPL |
|
# license : GPL |
###################################################################### |
|
###################################################################### |
|
|
|
wl_version="0.5.7pre1" |
|
wl_version="0.5.7pre2" |
|
|
|
###################################################################### |
|
###################################################################### |
#custom settings |
|
#custom settings |
|
|
|
PATH=$PATH:$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:usr/local/bin:/usr/local/sbin |
|
PATH=$PATH:$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:usr/local/bin:/usr/local/sbin |
|
|
|
|
|
wl_wlancf=`which wlanconfig` |
wl_iwccmd=`which iwconfig` |
|
wl_iwccmd=`which iwconfig` |
wl_iwlcmd=`which iwlist` |
|
wl_iwlcmd=`which iwlist` |
wl_ifccmd=`which ifconfig` |
|
wl_ifccmd=`which ifconfig` |
wl_hnmcmd=`which hostname` |
|
wl_hnmcmd=`which hostname` |
wl_awkcmd=`which awk` |
|
wl_awkcmd=`which awk` |
Line 348... |
|
Line 349... |
wl_macs=`ls $wl_hostap$wl_iface | grep 00` |
|
wl_macs=`ls $wl_hostap$wl_iface | grep 00` |
fi |
|
fi |
|
|
|
if [ -d $wl_madwifi$wl_iface ] |
|
if [ -d $wl_madwifi$wl_iface ] |
then |
|
then |
wl_numcl=`cat $wl_madwifi$wl_iface/associated_sta | grep -c macaddr` |
|
wl_numcl=`$wl_wlancf $wl_iface list sta | grep -c ^[0..9]` |
wl_macs=`cat $wl_madwifi$wl_iface/associated_sta | tr "<" "#" | tr ">" "#" | tr " " "#" | tr "\n" "#" | tr "m" "\n" ` |
|
# wl_numcl=`cat $wl_madwifi$wl_iface/associated_sta | grep -c macaddr` |
|
|
# wl_macs=`cat $wl_madwifi$wl_iface/associated_sta | tr "<" "#" | tr ">" "#" | tr " " "#" | tr "\n" "#" | tr "m" "\n" ` |
|
|
wl_macs=`$wl_wlancf $wl_iface list sta | grep ^[0..9] | tr " " "#"` |
fi |
|
fi |
|
|
|
echo $wlm_number_of_clients $wl_numcl |
|
echo $wlm_number_of_clients $wl_numcl |
|
|
|
wl_numcllast=$(($wl_numcllast + $wl_numcl)) |
|
wl_numcllast=$(($wl_numcllast + $wl_numcl)) |
|
|
|
for wl_mac in $wl_macs |
|
for wl_mac in $wl_macs |
Line 367... |
|
Line 369... |
wl_silence=`echo $wl_macparam | $wl_awkcmd '{print $4}' | sed 's/silence[=|:]//g'` |
|
wl_silence=`echo $wl_macparam | $wl_awkcmd '{print $4}' | sed 's/silence[=|:]//g'` |
fi |
|
fi |
|
|
|
if [ -d $wl_madwifi$wl_iface ] |
|
if [ -d $wl_madwifi$wl_iface ] |
then |
|
then |
wl_signal=`echo $wl_mac | $wl_awkcmd -F "#" '{print $7}'` |
|
wl_signal=`echo $wl_mac | tr "#" " " | $wl_awkcmd '{print $5}'` |
|
|
wl_rxtx=`echo $wl_mac | tr "#" " " | $wl_awkcmd '{print "rate="$4" tx="$8" rx="$9}'` |
wl_silence="0" |
|
wl_silence="0" |
wl_mac=`echo $wl_mac | $wl_awkcmd -F "#" '{print $3}'` |
|
wl_mac=`echo $wl_mac | tr "#" " " | $wl_awkcmd '{print $1}'` |
fi |
|
fi |
|
|
|
wl_cnt=$(($wl_signal - $wl_silence)) |
|
wl_cnt=$(($wl_signal - $wl_silence)) |
wl_ipc=`cat $wl_arp | grep -i $wl_mac | $wl_awkcmd '{print $1}'` # IP adresa peeru z arp tabulky |
|
wl_ipc=`cat $wl_arp | grep -i $wl_mac | $wl_awkcmd '{print $1}'` # IP adresa peeru z arp tabulky |
|
|
|
wl_name=`cat $wl_dhcpcnf | grep -i $wl_mac | $wl_awkcmd '{print $2}'` |
|
wl_name=`cat $wl_dhcpcnf | grep -i $wl_mac | $wl_awkcmd '{print $2}'` |
if [ "$wl_name" = "ethernet" ] || [ "$wl_name" = "" ] |
|
if [ "$wl_name" = "ethernet" ] || [ "$wl_name" = "" ] |
Line 410... |
|
Line 412... |
then |
|
then |
echo "" |
|
echo "" |
else |
|
else |
if [ -d $wl_hostap$wl_iface ] |
|
if [ -d $wl_hostap$wl_iface ] |
then |
|
then |
echo $wl_macparam | $wl_awkcmd '{print $1,$2" "}' |
|
echo -n $wl_macparam | $wl_awkcmd '{print $1,$2" "}' |
else |
|
fi |
echo "" |
|
if [ -d $wl_madwifi$wl_iface ] |
|
|
then |
|
|
echo -n $wl_rxtx |
fi |
|
fi |
|
|
echo "" |
fi |
|
fi |
w_bar |
|
w_bar |
else |
|
else |
if [ $wcm_macoff -eq 0 ] |
|
if [ $wcm_macoff -eq 0 ] |
then |
|
then |
Line 607... |
|
Line 612... |
if [ -d $wl_madwifi$wl_iface ] |
|
if [ -d $wl_madwifi$wl_iface ] |
then |
|
then |
wl_mode=`$wl_iwccmd $wl_iface | grep Mode | $wl_awkcmd '{print $1}' | sed 's/Mode://g'` |
|
wl_mode=`$wl_iwccmd $wl_iface | grep Mode | $wl_awkcmd '{print $1}' | sed 's/Mode://g'` |
if [ "a$wl_mode" = "aMaster" ] |
|
if [ "a$wl_mode" = "aMaster" ] |
then |
|
then |
wl_numcl=`cat $wl_madwifi$wl_iface/associated_sta | grep -c macaddr` |
|
wl_numcl=`$wl_wlancf $wl_iface list sta | grep -c ^[0..9]` |
wl_numcllast=$(($wl_numcllast + $wl_numcl)) |
|
wl_numcllast=$(($wl_numcllast + $wl_numcl)) |
fi |
|
fi |
fi |
|
fi |
done |
|
done |
wl_numclold=$wl_numcllast |
|
wl_numclold=$wl_numcllast |