![]() ![]() |
wifimon |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/bin/bash# author : Petr Simandl www.simandl.cz# release date : 29/12/2002# name : wifimon# version : 0.1 initial# description : hostap powered wifi card monitoring# license : GPLwl_iwccmd="/usr/local/sbin/iwconfig"wl_hostap="/proc/net/hostap/"wl_wireless="/proc/net/wireless"wlm_no_managed_or_master=" neni ani Master ani Managed..."wlm_number_of_clients="Pocet asociovanych klientu : "#wlm_no_managed_or_master=" is not Master or Managed..."#wlm_number_of_clients="Number of associated clients : "######################################################################w_bar(){until [ "$wl_cnt" -eq -1 ]doprintf "="wl_cnt=$(($wl_cnt - 1 ))doneprintf " \n"} # w_bar######################################################################w_managed(){ echo $wl_iwctxt | awk '{print $1,$3,$4,$5" "}'echo $wl_iwctxt | awk '{print $6,$9,$11" "}'#echo $wl_iwctxt | awk '{print $27,$28,$29,$31,$32" "}'#cat $wl_wireless | grep $wl_ifacewl_wtxt=`cat $wl_wireless | grep $wl_iface | awk '{print $3,$4,$5}' | sed 's/\.//g'`wl_quality=`echo $wl_wtxt | awk '{print $1}'`wl_signal=`echo $wl_wtxt | awk '{print $2}'`wl_signal=$(($wl_signal - 256))wl_noise=`echo $wl_wtxt | awk '{print $3}'`wl_noise=$(($wl_noise - 256))echo Quality:$wl_quality/92 Signal level:$wl_signal Noise level:$wl_noisewl_cnt=$wl_qualityw_bar#wl_cnt=$(($wl_cnt + 100))#w_barecho} # w_managed######################################################################w_master(){ echo $wl_iwctxt | awk '{print $1,$3,$4,$5" "}'echo $wl_iwctxt | awk '{print $6,$9,$11" "}'wl_numcl=`ls $wl_hostap$wl_iface | grep -c 00`echo $wlm_number_of_clients $wl_numclfor wl_mac in `ls $wl_hostap$wl_iface | grep 00`dowl_macparam=`cat $wl_hostap$wl_iface/$wl_mac | grep -E 'last_rx|last_tx'`wl_cnt=`echo $wl_macparam | awk '{print $5}' | sed 's/signal=//g'`echo $wl_mac Signal $wl_cnt $wl_macparam | awk '{print $1,$2,$3,$4,$5" "}'w_bardoneecho} # w_master######################################################################w_iface(){ wl_iwctxt=`$wl_iwccmd $wl_iface | grep -v 'Device|Some|Extension' | sed 's/ Nick/_Nick/g'`wl_mode=`echo $wl_iwctxt | awk '{print $5}' | sed 's/Mode://g'`if [ "a$wl_mode" = "aManaged" ]thenw_managedelif [ "a$wl_mode" = "aMaster" ]thenw_masterelseecho $wl_iface $wlm_no_managed_or_masterechofi}############################################################################################################################################clearwhile [ 1 ]dotput cup 0 0for wl_iface in `ls $wl_hostap`dow_ifacedone# tput cup 25 0sleep 1doneexit 0