This is the ruby-iwlist library, for high-level access to the output of ‘iwlist’

Copyright © 2007 Chris Riddoch <[email protected]>

This code is licensed under the LGPL v2.1; see the ‘LGPL’ file in the main directory of this project for details. Note that future versions of this software may be relicensed under a different version of the LGPL, but the choice is the copyright holders’ to make, not the user’s.

This project is maintained in git. The most recent version can always be found in the repository at repo.or.cz/w/ruby-iwlist.git

Use ‘git clone git://repo.or.cz/ruby-iwlist.git’ to clone the repository.

Usage

If ‘eth1’ is your wireless interface, the following will return a list of the essids within range.

IWList.scan(“eth1”).collect {|ap| ap.essid }

Of course, this script must be run as root, or iwlist won’t return any results. Be VERY CAREFUL with any scripts you write that use this library! You’ve been warned.

This library will run the iwlist command from the wireless_tools package. wireless_tools is probably avaiable and installed by default by your distribution. If not, you can find it at the following URL: www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html