Python script for configuring wifi hot spots on FreeBSD

Andrew Gould andrewlylegould at gmail.com
Wed Aug 20 15:44:23 UTC 2008


I just finished a Python script that:

1. prompts the user to select a wifi device from a list compiled from the
results of ifconfig and dmesg;
2. prompts the user to select an Access Point (SSID) from a list derived
from 'ifconfig [device] scan'; and
3. configures the wifi device using the chosen wifi device, SSID and
dhclient.

The script works with my system setup (ural0 and wi0 on FreeBSD 7.0); but
I'd like someone to review the script because:

1. I made several assumptions about patterns in the output of ifconfig and
dmesg based upon 2 wifi adapters.
    I'd like to make sure the assumptions don't break with other hardware.

2. I store data in Python dictionaries.  When I display the dictionaries,
the numbered options are not in order and I can't
    figure out how to sort them.  This appears to be a cosmetic issue only;
but it still bothers me.

3. My knowledge of networking is at a basic level.

I have attached the script -- it is only 4KB.

I would appreciate any advice/help.

Thanks,

Andrew


More information about the freebsd-questions mailing list