From owner-freebsd-questions@FreeBSD.ORG Wed Aug 20 15:44:23 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53EDD106564A for ; Wed, 20 Aug 2008 15:44:23 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.229]) by mx1.freebsd.org (Postfix) with ESMTP id 212978FC17 for ; Wed, 20 Aug 2008 15:44:23 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so806575rvf.43 for ; Wed, 20 Aug 2008 08:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=nlfHz+XRBjE2v+f5w2yq5yl64TrzLxQMw5OOV5zYzZA=; b=dMDIoCrPBbwyHLqJVWHWshGHtimg6++990nMwhf+Ze7DO8EjFKszvZL797/HSU547E 4wVWPM1CzBGDeair0yE/k42UyxVmNLtUPtzTpY7Hz+KzZZoyxKQ3ggjMCsEoAeeHhd1l aNryCdnFehgYPwuPNNwRbr666ZFHZfGF/mQag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=og1BtSN5FHKjSr0vUUGCwmz6FPmuPPoA4z1aVYWuBDwTobkWC8SOqO99YVMKBzn5my 4fYFVH0ttbDNoFLG/fzMIDdsdxUJzBlqT0KG5jSfaZNIeaw5d2WGyM73rSE6Tk3EpFXU YA8nYVJUrqutmyVAbSUAjB8O7MQQx/HPf97DA= Received: by 10.141.83.15 with SMTP id k15mr129866rvl.74.1219247062829; Wed, 20 Aug 2008 08:44:22 -0700 (PDT) Received: by 10.140.199.11 with HTTP; Wed, 20 Aug 2008 08:44:22 -0700 (PDT) Message-ID: Date: Wed, 20 Aug 2008 10:44:22 -0500 From: "Andrew Gould" To: "FreeBSD Questions Mailing List" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_21082_23961226.1219247062834" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Python script for configuring wifi hot spots on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Aug 2008 15:44:23 -0000 ------=_Part_21082_23961226.1219247062834 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_21082_23961226.1219247062834--