NetBSD: A script for wifi connections


I find very difficult to deal with wifi connections when you are in mobility and use more than one connection. You can use wpa_gui to scan your networks but probably you then need to launch ‘dhclient’ to adquire the ip address and gateway. So, some manual operations are required. I prefer something more automatic.

I coded a perl script to scan for networks, select one of them, and get connected launching wpa_supplicant and dhclient. And it’s capable of monitoring the connection.

This is script is not perfect. In fact only WEP and WPA are tested. I’m sure there’s some bug, but it works very well most of the time and fits my needings.

The code is available in:

http://www.4shared.com/file/rrHidGn7/wificonnection.html

The script must be execute as root in a terminal. It requires:

  • wpa_supplicant
  • wiconfig
  • dhclient
  • perl (with a binary or simlink as /usr/bin/perl)

There’s no guarantee the script work in most of the cases, but it fit my needings. If any of you improve the code, please, let me know.

About jjjesss

I'm a guy interested in technology, bsd fan and concerned about the world around.
This entry was posted in BSD, NetBSD, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s