Airport status

Alex Tweedly alex at tweedly.net
Mon Mar 14 11:37:19 EST 2005


Richard Miller wrote:

> Found this info:
>
> ------------------------------
>
> " For those who are interested, I found a way to show airport signal 
> strength (and other airport info). Download this airport CLI tool 
> (http://www.macstumbler.com/airport.tar.gz) and find a place for it (I 
> put mine in /usr/local/bin). After that, it's pretty easy. This is the 
> script that I ended up using, it uses backslashes for a 10-bar 
> display, then shows the percentage."
>
> /usr/local/bin/airport | awk 'NR == 2 {for (a=10;a>0;a-=1) if ($1 / 10 
> < a) printf("`"); else printf("\\"); print " " $1}'
>
> ------------------------------
>
> Can sometime tell me how to convert and use this from Rev?

Sorry this is untested - no Unix available - but if I remember right .....

this is taking the output from the "airport" program, and piping it into 
an awk script which takes the second line of input and uses the first 
token (word) of it as a percentage value. So all you need is

put shell("/usr/local/bin/airport") into tMyVar
put word 1 of line 2 of tMyVar into tPercent

and then do whatever you want with that value, probably something like
if tPercent < 50 then
   beep
   answer info "You are out of wireless range !" with "OK"
end if

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.2 - Release Date: 11/03/2005



More information about the use-livecode mailing list