/usr/local/bin/netchoose

BASICS
netchoose is a GUI (QT based) wrapper for helping users who need to connect to multiple wireless network connections on a routine basis. netchoose's strengths are it allows the user great customization on a per-address basis.

OPERATION
On startup netchoose presents the user with the list of available connections as found by "/sbin/iwlist scan".
The user has the options of:
Activate:
netchoose will look in it's database for the network address. If found it will try to activate the connection using that information. If not, then it will use the the "default" database entry to try to activate the connection.

Refresh:
This will rerun "/sbin/iwlist scan" and present the user with the latest list of available connections.

Customize:
This will bring up the database editor with the selected connection information filled out. The user can then customize the connection before trying to activate it.

Edit Database:
This brings up the database editor. The user can edit the saved and default settings for connections. The Previous and Next buttons are used to traverse through the entries. Delete will delete this entry. No permanent changes are really made to the cells.xml file until Save is pressed.


Each unique address can have it's own database entry. The meanings of the fields are as follows:
address:  The hex based address of the network connection.
essid:  The name/id of the network connection.
interface: The OS interface (eth0, wlan0) to use.
key: If encrypted, key to use.

Auto DHCP configure checkbox:
If checked, netchoose will try to use dhclient to configure the network.
If not checked, then the values below will be used to configure the network manually.

ip addr: IP address to set this connection to.
netmask: netmask value of connection (ex. 255.255.255.0)
gateway: gateway to use for this connection
nameserver: nameserver to use with this connection

The "Commands to run in bash:" text edit box contains the actual script that will be run when you try to activate to this connection. You can customize or add your own pre/post steps to the process. The above values are passed as environmental variables (see INTERNALS and activate.sh script for details/example).


INTERNALS
The database is a plain xml file located at:
/usr/local/share/netchoose/cells.xml

The default shell script used to connect is located at:
/usr/local/share/netchoose/activate.sh
netchoose passes environmental variables to the script based on what iwlist and it's database contained about the connection. The meanings of the environmental variables are the same as the database entries. If a value is not set, the environmental variable will be unset and therefore not passed. ip addr is passed as just "ip". Auto DHCP is passed as "do_dhcp".



COMMON ISSUES
1) Does not work and I get a lot of complaints about permissions.
You have to be root to use netchoose.

2) I see not see cells or wrong information about them.
Since netchoose parses the output of /sbin/iwlist it is very sensitive to it's formatting. Older versions of iwlist output different syntax. netchoose was developed and tested on FC3 and it's version of iwlist (wireless-tools = 1:27). If you email me (e_berta@plutospin.com) your output of /sbin/iwlist I can try to modify the parsing to make it work.

3) I deleted the "default" database entry and now things do not work.
You have two options:
 a) Restore the original database (will blow away your additions to it):
cp /usr/local/share/netchoose/oricells.xml  /usr/local/share/netchoose/cells.xml

 b) Or make a existing entry the new default by setting address and essid to "default", choosing DHCP and setting the script to run as: /usr/local/share/netchoose/activate.sh

4) I've got some special security tool/options I need to do for it to work with some networks I want it to connect to.
Remember you always have the option on a per-address basis to completely replace the default script it uses to try to connect to the network with your own. Just remember to return 0 from the script if it succeeds.