1 | 2 | simandl | #!/bin/bash |
2 | 3 | simandl | # authors : Petr Simandl www.simandl.cz |
3 | 14 | simandl | # : Fyzik, Covex, Tydyt |
4 | | | # release date : 05/10/2003 |
5 | 2 | simandl | # name : wifimon |
6 | | | # description : hostap powered wifi card monitoring |
7 | | | # license : GPL |
8 | | | |
9 | 14 | simandl | wl_version="0.5.0" |
10 | 11 | simandl | |
11 | 13 | simandl | PATH=$PATH:$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:usr/local/bin:/usr/local/sbin |
12 | | | |
13 | 14 | simandl | wl_iwccmd=`which iwconfig` |
14 | | | wl_ifccmd=`which ifconfig` |
15 | | | wl_hnmcmd=`which hostname` |
16 | | | wl_awkcmd=`which awk` |
17 | | | |
18 | | | wl_tptcmde="[1;1H" |
19 | | | wl_clrcmde="[H[2J" |
20 | | | |
21 | | | wl_hostap="/proc/net/hostap/" |
22 | | | wl_wireless="/proc/net/wireless" |
23 | | | wl_arp="/proc/net/arp" |
24 | | | wl_dhcpcnf="/etc/dhcpd.conf" |
25 | | | wl_dhcplss="/var/lib/dhcp/dhcpd.leases" |
26 | | | |
27 | | | #testing all settings |
28 | | | |
29 | 12 | simandl | if [ "$wl_iwccmd x" = " x" ] |
30 | | | then |
31 | | | echo "iwconfig not found" |
32 | | | exit 1 |
33 | | | fi |
34 | 2 | simandl | |
35 | 14 | simandl | if [ "$wl_ifccmd x" = " x" ] |
36 | | | then |
37 | | | echo "ifconfig not found" |
38 | | | exit 1 |
39 | | | fi |
40 | 4 | simandl | |
41 | 14 | simandl | if [ "$wl_hnmcmd x" = " x" ] |
42 | | | then |
43 | | | echo "hostname not found" |
44 | | | exit 1 |
45 | | | fi |
46 | | | |
47 | | | if [ "$wl_awkcmd x" = " x" ] |
48 | | | then |
49 | | | echo "awk not found" |
50 | | | exit 1 |
51 | | | fi |
52 | | | |
53 | | | if [ -d $wl_hostap ] |
54 | | | then |
55 | | | wl_nop=1 |
56 | | | else |
57 | | | echo "hostap not found" |
58 | | | exit 1 |
59 | | | fi |
60 | | | |
61 | | | if [ -e $wl_wireless ] |
62 | | | then |
63 | | | wl_nop=1 |
64 | | | else |
65 | | | echo "$wl_wireless not found" |
66 | | | exit 1 |
67 | | | fi |
68 | | | |
69 | | | if [ -e $wl_arp ] |
70 | | | then |
71 | | | wl_nop=1 |
72 | | | else |
73 | | | echo "$wl_arp not found" |
74 | | | exit 1 |
75 | | | fi |
76 | | | |
77 | | | if [ -e $wl_dhcpcnf ] |
78 | | | then |
79 | | | wl_nop=1 |
80 | | | else |
81 | | | echo "$wl_dhcpcnf not found" |
82 | | | wl_dhcpcnf="/dev/null" |
83 | | | fi |
84 | | | |
85 | | | if [ -e $wl_dhcplss ] |
86 | | | then |
87 | | | wl_nop=1 |
88 | | | else |
89 | | | echo "$wl_dhcplss not found" |
90 | | | wl_dhcplss="/dev/null" |
91 | | | fi |
92 | | | |
93 | 13 | simandl | wl_header_refresh="<html><head><meta HTTP-EQUIV=\"Refresh\" CONTENT=\"3\"><title>Wifimon @ `$wl_hnmcmd`</title></head><body BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"><pre>" |
94 | | | wl_header="<html><head><title>Wifimon @ `$wl_hnmcmd`</title></head><body BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"><pre>" |
95 | 7 | simandl | wl_footer="</pre></body></html>" |
96 | | | |
97 | | | wlm_no_managed_or_master=" neni ani Master ani Managed..." |
98 | | | wlm_number_of_clients="Pocet asociovanych klientu : " |
99 | | | wlm_unknown="Nezname parametry nebo neplatne jmeno rozhrani : " |
100 | | | #wlm_no_managed_or_master=" is not Master or Managed..." |
101 | | | #wlm_number_of_clients="Number of associated clients : " |
102 | | | |
103 | 11 | simandl | wlch_signal="=" |
104 | | | wlch_noise="*" |
105 | | | |
106 | 2 | simandl | ###################################################################### |
107 | 11 | simandl | w_col() |
108 | 10 | simandl | { |
109 | 11 | simandl | wlc_red=`tput setaf 1` |
110 | | | wlc_green=`tput setaf 2` |
111 | | | wlc_brown=`tput setaf 3` |
112 | | | wlc_blue=`tput setaf 4` |
113 | | | wlc_magenta=`tput setaf 5` |
114 | | | wlc_lblue=`tput setaf 6` |
115 | | | wlc_grey=`tput setaf 7` |
116 | | | wlc_std=`tput sgr0` |
117 | | | |
118 | | | wlc_ip=$wlc_lblue # ip address color |
119 | | | wlc_mac=$wlc_magenta # mac address color |
120 | | | wlc_sig=$wlc_red # signal number color |
121 | | | wlc_bar=$wlc_green # signal bar color |
122 | 10 | simandl | } |
123 | | | ###################################################################### |
124 | 4 | simandl | w_bw() |
125 | | | { |
126 | 6 | simandl | wlc_ip="" |
127 | | | wlc_mac="" |
128 | | | wlc_sig="" |
129 | | | wlc_bar="" |
130 | | | wlc_std="" |
131 | 4 | simandl | } |
132 | | | ###################################################################### |
133 | 2 | simandl | w_bar() |
134 | | | { |
135 | 4 | simandl | echo -n "${wlc_bar}" |
136 | 11 | simandl | wl_neg=`expr $wl_cnt \< 0 ` |
137 | | | if [ "$wl_neg" -eq 1 ] |
138 | | | then |
139 | | | wl_cnt=$(($wl_cnt * -1 )) |
140 | | | wl_bar=$wlch_noise |
141 | | | else |
142 | | | wl_bar=$wlch_signal |
143 | | | fi |
144 | 2 | simandl | until [ "$wl_cnt" -eq -1 ] |
145 | | | do |
146 | 11 | simandl | echo -n "$wl_bar" |
147 | 2 | simandl | wl_cnt=$(($wl_cnt - 1 )) |
148 | | | done |
149 | | | printf " \n" |
150 | 6 | simandl | echo -n "${wlc_std}" |
151 | 11 | simandl | # tput sgr0 |
152 | 2 | simandl | } # w_bar |
153 | | | |
154 | | | ###################################################################### |
155 | 13 | simandl | w_pkts() |
156 | | | { |
157 | | | wl_macpkts=`cat $wl_hostap$wl_iface/$wl_mac | grep -E 'rx\[|tx\[' | sed 's/=/ /g'` |
158 | 14 | simandl | wl_nt1=`echo $wl_macpkts | $wl_awkcmd '{print $2}'` |
159 | | | wl_nt2=`echo $wl_macpkts | $wl_awkcmd '{print $4}'` |
160 | | | wl_nt5=`echo $wl_macpkts | $wl_awkcmd '{print $6}'` |
161 | | | wl_nt11=`echo $wl_macpkts | $wl_awkcmd '{print $8}'` |
162 | | | wl_nr1=`echo $wl_macpkts | $wl_awkcmd '{print $10}'` |
163 | | | wl_nr2=`echo $wl_macpkts | $wl_awkcmd '{print $12}'` |
164 | | | wl_nr5=`echo $wl_macpkts | $wl_awkcmd '{print $14}'` |
165 | | | wl_nr11=`echo $wl_macpkts | $wl_awkcmd '{print $16}'` |
166 | 13 | simandl | |
167 | | | if [ $wcm_ppkts -eq 1 ] |
168 | | | then |
169 | | | wl_pksize=$((98)) |
170 | | | wl_nt=$(($wl_nt1 + $wl_nt2 + wl_nt5 + wl_nt11)) |
171 | | | if [ "$wl_nt1" -eq 0 ] |
172 | | | then |
173 | | | wl_nt1n="00" |
174 | | | else |
175 | | | wl_nt1n=$(($wl_pksize * $wl_nt1 / $wl_nt + 1)) |
176 | | | [ "$wl_nt1n" -lt 10 ] && wl_nt1n="0"$wl_nt1n |
177 | | | fi |
178 | | | if [ "$wl_nt2" -eq 0 ] |
179 | | | then |
180 | | | wl_nt2n="00" |
181 | | | else |
182 | | | wl_nt2n=$(($wl_pksize * $wl_nt2 / $wl_nt + 1)) |
183 | | | [ "$wl_nt2n" -lt 10 ] && wl_nt2n="0"$wl_nt2n |
184 | | | fi |
185 | | | if [ "$wl_nt5" -eq 0 ] |
186 | | | then |
187 | | | wl_nt5n="00" |
188 | | | else |
189 | | | wl_nt5n=$(($wl_pksize * $wl_nt5 / $wl_nt + 1)) |
190 | | | [ "$wl_nt5n" -lt 10 ] && wl_nt5n="0"$wl_nt5n |
191 | | | fi |
192 | | | if [ "$wl_nt11" -eq 0 ] |
193 | | | then |
194 | | | wl_nt11n="00" |
195 | | | else |
196 | | | wl_nt11n=$(($wl_pksize * $wl_nt11 / $wl_nt + 1)) |
197 | | | [ "$wl_nt11n" -lt 10 ] && wl_nt11n="0"$wl_nt11n |
198 | | | fi |
199 | | | wl_nr=$((1 + $wl_nr1 + $wl_nr2 + wl_nr5 + wl_nr11)) |
200 | | | if [ "$wl_nr1" -eq 0 ] |
201 | | | then |
202 | | | wl_nr1n="00" |
203 | | | else |
204 | | | wl_nr1n=$(($wl_pksize * $wl_nr1 / $wl_nr + 1)) |
205 | | | [ "$wl_nr1n" -lt 10 ] && wl_nr1n="0"$wl_nr1n |
206 | | | fi |
207 | | | if [ "$wl_nr2" -eq 0 ] |
208 | | | then |
209 | | | wl_nr2n="00" |
210 | | | else |
211 | | | wl_nr2n=$(($wl_pksize * $wl_nr2 / $wl_nr + 1)) |
212 | | | [ "$wl_nr2n" -lt 10 ] && wl_nr2n="0"$wl_nr2n |
213 | | | fi |
214 | | | if [ "$wl_nr5" -eq 0 ] |
215 | | | then |
216 | | | wl_nr5n="00" |
217 | | | else |
218 | | | wl_nr5n=$(($wl_pksize * $wl_nr5 / $wl_nr + 1)) |
219 | | | [ "$wl_nr5n" -lt 10 ] && wl_nr5n="0"$wl_nr5n |
220 | | | fi |
221 | | | if [ "$wl_nr11" -eq 0 ] |
222 | | | then |
223 | | | wl_nr11n="00" |
224 | | | else |
225 | | | wl_nr11n=$(($wl_pksize * $wl_nr11 / $wl_nr + 1)) |
226 | | | [ "$wl_nr11n" -lt 10 ] && wl_nr11n="0"$wl_nr11n |
227 | | | fi |
228 | | | echo -n "Tx" $wl_nt1n $wl_nt2n $wl_nt5n $wl_nt11n "Rx" $wl_nr1n $wl_nr2n $wl_nr5n $wl_nr11n "" |
229 | | | fi |
230 | | | |
231 | | | [ $wcm_pkts -eq 1 ] && echo -n "Tx" $wl_nt1 $wl_nt2 $wl_nt5 $wl_nt11 "Rx" $wl_nr1 $wl_nr2 $wl_nr5 $wl_nr11 "" |
232 | | | |
233 | | | } # w_pkts |
234 | | | ###################################################################### |
235 | 2 | simandl | w_managed() |
236 | 14 | simandl | { echo $wl_iwctxt | $wl_awkcmd '{print $1,$3,$4,$5" "}' |
237 | | | echo -n `$wl_ifccmd $wl_iface | grep -E "inet addr|inet adr" | $wl_awkcmd '{print $2" "}' | sed s/ad*r://g`" " # IP adresa mastera z ifconfig |
238 | | | echo $wl_iwctxt | $wl_awkcmd '{print $9,$6,$11" "}' |
239 | | | wl_wtxt=`cat $wl_wireless | grep $wl_iface | $wl_awkcmd '{print $3,$4,$5}' | sed 's/\.//g'` |
240 | | | wl_quality=`echo $wl_wtxt | $wl_awkcmd '{print $1}'` |
241 | | | wl_signal=`echo $wl_wtxt | $wl_awkcmd '{print $2}'` |
242 | 2 | simandl | wl_signal=$(($wl_signal - 256)) |
243 | 14 | simandl | wl_noise=`echo $wl_wtxt | $wl_awkcmd '{print $3}'` |
244 | 2 | simandl | wl_noise=$(($wl_noise - 256)) |
245 | 5 | simandl | echo "Quality:${wlc_sig}$wl_quality${wlc_std}/92 Signal level:$wl_signal Noise level:$wl_noise " |
246 | 2 | simandl | wl_cnt=$wl_quality |
247 | | | w_bar |
248 | | | echo |
249 | | | } # w_managed |
250 | | | |
251 | | | ###################################################################### |
252 | | | w_master() |
253 | 5 | simandl | { if [ $wcm_oneline -eq 0 ] |
254 | | | then |
255 | 14 | simandl | echo $wl_iwctxt | $wl_awkcmd '{print $1,$3,$4,$5" "}' |
256 | | | echo $wl_iwctxt | $wl_awkcmd '{print $6,$9,$11" "}' |
257 | 5 | simandl | else |
258 | 14 | simandl | echo $wl_iwctxt | $wl_awkcmd '{print $1,$4,$5,$6,$11" "}' | sed 's/ [^": ]*:/ /g' |
259 | 5 | simandl | fi |
260 | 11 | simandl | |
261 | 2 | simandl | wl_numcl=`ls $wl_hostap$wl_iface | grep -c 00` |
262 | | | echo $wlm_number_of_clients $wl_numcl |
263 | 13 | simandl | |
264 | 5 | simandl | wl_numcllast=$(($wl_numcllast + $wl_numcl)) |
265 | 13 | simandl | |
266 | 3 | simandl | for wl_mac in `ls $wl_hostap$wl_iface | grep 00 ` |
267 | 2 | simandl | do |
268 | 11 | simandl | wl_macparam=`cat $wl_hostap$wl_iface/$wl_mac | grep -E 'last_rx|last_tx' | sed 's/last_//g'` |
269 | 14 | simandl | wl_signal=`echo $wl_macparam | $wl_awkcmd '{print $5}' | sed 's/signal=//g'` |
270 | | | wl_silence=`echo $wl_macparam | $wl_awkcmd '{print $4}' | sed 's/silence=//g'` |
271 | 11 | simandl | wl_cnt=$(($wl_signal - $wl_silence)) |
272 | 14 | simandl | wl_ipc=`cat $wl_arp | grep -i $wl_mac | $wl_awkcmd '{print $1}'` # IP adresa peeru z arp tabulky |
273 | 13 | simandl | |
274 | 14 | simandl | wl_name=`cat $wl_dhcpcnf | grep -i $wl_mac | $wl_awkcmd '{print $2}'` |
275 | | | if [ "$wl_name" = "ethernet" ] || [ "$wl_name" = "" ] |
276 | | | then |
277 | | | wl_name=`cat $wl_dhcpcnf | grep -i $wl_mac -B 1 | $wl_awkcmd '{print$2,$3}' | grep -i $wl_mac -v | $wl_awkcmd '{print$1}'` |
278 | | | if [ "$wl_name" = "" ] |
279 | | | then |
280 | | | wl_name=`cat $wl_dhcplss | grep -i $wl_mac -A 2 | $wl_awkcmd '{print$2,$3}' | grep -i $wl_mac -v | $wl_awkcmd '{print$1}'` |
281 | | | wl_name=`echo $wl_name | $wl_awkcmd '{print$1}' ` |
282 | | | fi |
283 | | | fi |
284 | 13 | simandl | if [ $wcm_ppkts -eq 1 ] || [ $wcm_pkts -eq 1 ] |
285 | | | then |
286 | | | w_pkts |
287 | | | fi |
288 | | | |
289 | 5 | simandl | if [ $wcm_oneline -eq 0 ] |
290 | | | then |
291 | 11 | simandl | echo -n "$wl_name " |
292 | 5 | simandl | echo -n "${wlc_ip}$wl_ipc${wlc_std} " |
293 | 11 | simandl | echo -n "${wlc_mac}$wl_mac${wlc_std} Signal ${wlc_sig}$wl_cnt${wlc_std} " |
294 | 14 | simandl | echo $wl_macparam | $wl_awkcmd '{print $1,$2" "}' |
295 | 5 | simandl | w_bar |
296 | | | else |
297 | 11 | simandl | echo -n "$wl_name " |
298 | | | echo -n "${wlc_mac}$wl_mac${wlc_std} ${wlc_sig}$wl_cnt${wlc_std} " |
299 | 5 | simandl | w_bar |
300 | | | fi |
301 | 4 | simandl | done |
302 | 11 | simandl | |
303 | | | echo |
304 | 2 | simandl | } # w_master |
305 | | | |
306 | | | ###################################################################### |
307 | | | w_iface() |
308 | 13 | simandl | { wl_iwctxt=`$wl_iwccmd $wl_iface 2>/dev/null | grep -v 'Device|Some|Extension' | sed 's/ Nick/_Nick/'` |
309 | 14 | simandl | wl_mode=`echo $wl_iwctxt | $wl_awkcmd '{print $5}' | sed 's/Mode://g'` |
310 | 2 | simandl | if [ "a$wl_mode" = "aManaged" ] |
311 | | | then |
312 | | | w_managed |
313 | 8 | simandl | elif [ "a$wl_mode" = "aAd-Hoc" ] |
314 | | | then |
315 | | | w_managed |
316 | 2 | simandl | elif [ "a$wl_mode" = "aMaster" ] |
317 | | | then |
318 | | | w_master |
319 | | | else |
320 | | | echo $wl_iface $wlm_no_managed_or_master |
321 | | | echo |
322 | | | fi |
323 | | | } |
324 | | | |
325 | | | ###################################################################### |
326 | 11 | simandl | w_version() |
327 | | | { |
328 | | | echo wifimon $wl_version |
329 | | | exit 0 |
330 | | | } |
331 | | | ###################################################################### |
332 | 5 | simandl | w_help() |
333 | | | { |
334 | 3 | simandl | echo Pouziti: wifimon [param] |
335 | | | echo param: |
336 | 11 | simandl | echo -v vypise verzi |
337 | 5 | simandl | echo -html generovani html stranky |
338 | 13 | simandl | echo -col barevny vypis na obrazovku |
339 | 5 | simandl | echo -once vypsani jen jednoho vypisu a pak program skonci |
340 | | | echo -oneline vypsani klientu na jednu linku |
341 | 13 | simandl | echo -ppkts vypsani procentniho pomeru 1M, 2M, 5.5M a 11M paketu pro jednotlive klienty |
342 | | | echo -pkts vypsani poctu 1M, 2M, 5.5M a 11M paketu pro jednotlive klienty |
343 | 5 | simandl | echo -wlan0 -wlan1 -wlan2 vypise jen uvedene karty a to v danem poctu a poradi |
344 | 3 | simandl | echo bez parametru cyklicky vypis na obrazovku |
345 | 5 | simandl | exit 0 |
346 | | | } |
347 | | | ###################################################################### |
348 | | | ###################################################################### |
349 | 2 | simandl | |
350 | 5 | simandl | wl_unknown="" |
351 | | | wl_cnt=1 |
352 | | | wcm_clear=1 |
353 | | | wcm_once=0 |
354 | 11 | simandl | wcm_col=0 |
355 | 5 | simandl | wcm_oneline=0 |
356 | | | wcm_html=0 |
357 | 13 | simandl | wcm_ppkts=0 |
358 | | | wcm_pkts=0 |
359 | 5 | simandl | wcm_ifc="" |
360 | | | |
361 | 6 | simandl | # parsing input parameters |
362 | 5 | simandl | while [ "a$1" != "a" ] |
363 | | | do |
364 | | | case $1 in |
365 | 11 | simandl | -v) |
366 | | | w_version |
367 | | | ;; |
368 | 5 | simandl | -help) |
369 | | | w_help |
370 | | | ;; |
371 | | | -once) |
372 | | | wcm_once=1 |
373 | | | shift |
374 | | | ;; |
375 | | | -oneline) |
376 | | | wcm_oneline=1 |
377 | | | shift |
378 | | | ;; |
379 | 11 | simandl | -col) |
380 | | | wcm_col=1 |
381 | 5 | simandl | shift |
382 | | | ;; |
383 | | | -html) |
384 | | | wcm_html=1 |
385 | | | shift |
386 | | | ;; |
387 | 13 | simandl | -ppkts) |
388 | | | wcm_ppkts=1 |
389 | | | shift |
390 | | | ;; |
391 | | | -pkts) |
392 | | | wcm_pkts=1 |
393 | | | shift |
394 | | | ;; |
395 | 5 | simandl | *) |
396 | | | wl_flg=0 |
397 | | | for wl_iface in `ls $wl_hostap` |
398 | | | do |
399 | | | if [ "a-$wl_iface" = "a$1" ] |
400 | | | then |
401 | | | wcm_ifc="$wcm_ifc $wl_iface" |
402 | | | wl_flg=1 |
403 | | | fi |
404 | | | done |
405 | | | if [ $wl_flg -eq 0 ] |
406 | | | then |
407 | | | wl_unknown="$wl_unknown$1 " |
408 | | | fi |
409 | | | shift |
410 | | | esac |
411 | | | done |
412 | | | |
413 | 6 | simandl | # printing the list of bad parameters (if there are some) |
414 | 5 | simandl | if [ "a$wl_unknown" != "a" ] |
415 | | | then |
416 | | | echo "$wlm_unknown $wl_unknown" |
417 | | | w_help |
418 | | | fi |
419 | | | |
420 | 6 | simandl | # if no interface is selected then all available are choosen |
421 | 5 | simandl | if [ "a$wcm_ifc" = "a" ] |
422 | | | then |
423 | | | wcm_ifc=`ls $wl_hostap` |
424 | | | fi |
425 | | | |
426 | 6 | simandl | # setting for old and last same value to avoid double clear after start |
427 | | | wl_numcllast=0 |
428 | | | wl_numclold=0 |
429 | | | for wl_iface in $wcm_ifc |
430 | | | do |
431 | | | wl_numcl=`ls $wl_hostap$wl_iface | grep -c 00` |
432 | | | wl_numcllast=$(($wl_numcllast + $wl_numcl)) |
433 | | | done |
434 | | | wl_numclold=$wl_numcllast |
435 | | | |
436 | 11 | simandl | if [ $wcm_col -eq 0 ] |
437 | 6 | simandl | then |
438 | | | w_bw |
439 | 11 | simandl | else |
440 | | | w_col |
441 | 6 | simandl | fi |
442 | | | |
443 | 13 | simandl | if [ $wcm_html -eq 1 ] |
444 | | | then |
445 | | | w_bw |
446 | | | [ $wcm_once -eq 1 ] && echo $wl_header || echo $wl_header_refresh |
447 | | | for wl_iface in $wcm_ifc |
448 | | | do |
449 | | | w_iface |
450 | | | done |
451 | | | echo $wl_footer |
452 | | | exit 0 |
453 | | | fi |
454 | | | |
455 | 14 | simandl | #this is main loop and it will be executer forever |
456 | 6 | simandl | while [ 1 ] |
457 | 5 | simandl | do |
458 | 14 | simandl | |
459 | | | # when the number of associated klients has changed we will set for clear screen |
460 | 5 | simandl | if [ $wl_numcllast -ne $wl_numclold ] |
461 | | | then |
462 | | | wl_numclold=$wl_numcllast |
463 | | | wcm_clear=1 |
464 | | | fi |
465 | 14 | simandl | |
466 | | | #if it is set for clear screen we will do it except we produce single report |
467 | | | if [ $wcm_clear -eq 1 -a $wcm_once -eq 0 ] |
468 | 5 | simandl | then |
469 | 14 | simandl | echo -n $wl_clrcmde |
470 | 5 | simandl | wcm_clear=0 |
471 | | | fi |
472 | | | wl_numcllast=0 |
473 | 11 | simandl | |
474 | 14 | simandl | #for cyclic report we are trying to set cursor to the top left screen corner |
475 | | | if [ $wcm_once -eq 0 ] |
476 | | | then |
477 | | | echo -n $wl_tptcmde |
478 | | | fi |
479 | | | |
480 | | | #make report for all desired interfaces |
481 | 13 | simandl | for wl_iface in $wcm_ifc |
482 | | | do |
483 | | | w_iface |
484 | | | done |
485 | | | |
486 | 14 | simandl | #when a single report is needed than we are exiting |
487 | 5 | simandl | if [ $wcm_once -eq 1 ] |
488 | | | then |
489 | | | exit 0 |
490 | | | fi |
491 | | | sleep 1 |
492 | 6 | simandl | done |
493 | 5 | simandl | |
494 | | | exit 0 |
495 | | | |