Contributed by sean on from the airborne packets dept.
So, I got tired of doing my little time saving workarounds every time I connected to a wireless network and decided to look for a solution. Several people have posted little wireless scripts here, to misc@ and minor modifications to help simplify and automate the configuration of wireless, but the scripts never seemed to go far enough. That said, I took the shut up and hack motto and crafted my own solution that is more complete and well, "sucks less" than everyone else's solution (in my humble opinion). I've tried to keep it simple and as minimally intrusive as possible.
The following is an excerpt from the script's comments:
# EXAMPLE # Manually configure a wireless interface # # # sh /etc/wiconfig iwi0 # # Automatically scan for wireless networks and, using previous manual # configurations, configure the wireless interface based on the strongest # wireless signal (for use with hostname.if(5) files) # # $ cat /etc/hostname.iwi0 # !/bin/sh /etc/wiconfig -q \$if # # With the above /etc/hostname.iwi0 in place, iwi0 will be configured # upon startup or whenever /etc/netstart iwi0 is invoked. # # wiconfig can also be used in conjunction with apmd. In the following # example, upon resume, it'll check the status of the wireless connection # and, if there is no network connection, it'll automatically scan for # wireless networks and, using previous manual configurations, configure # the wireless interface based on the strongest wireless signal. # # $ cat /etc/apmd/resume # #!/bin/sh # /bin/sh /etc/wiconfig -qs iwi0I think this script will be quite useful for anyone who uses wireless on OpenBSD and enjoys taking his or her notebook places. That said, while this has been working well for me over the past couple of days, consider this a beta.
I would like others to give it a test-drive and provide feedback. Also, know that I am not a programmer by profession. While I've done minor scripts here and there, this is the largest script I've ever written and I learned a fair amount about pdksh in the process. I took some queues from other related scripts and reviewed some of the scripts used by OpenBSD in writing this so I'd appreciate feedback here as well and welcome patches.
It is my hope that the time I spent writing this will save time for many people when it comes to wireless on OpenBSD. The "wiconfig" script can currently be downloaded from http://bink.mooo.com/~daniel/pub/, but please know I've only used it on OpenBSD 5.0.
(Comments are closed)