Simple wifi chooser for OpenBSD
C Groff Shell Makefile
Latest commit ea68f76 Jan 2, 2017 Steven Dee Add note about secured -> open networks
Side note, I'm happy to change this if anyone requests it.

README

autonet - automatically connect to a known wifi network
=======================================================
autonet is a simple wifi network chooser for OpenBSD.

Installation
------------
Edit Makefile.inc to match your local setup (autonet is installed
into /usr/local by default.)

Then enter the following commands to build and install autonet
(install may need to be run as root):

    make obj
    make
    make install


Using autonet
-------------
Run "autonet". autonet will scan for networks. If it sees one that
it recognizes, it will create the appropriate hostname.if(5) file
as a symlink into /etc/hostname.d (described below) and exec
/etc/netstart <ifname>.

autonet does not continuously monitor for network changes in the
background. It doesn't show you a list of networks and ask you to
pick one. It doesn't communicate over dbus. It has no runtime
configuration whatsoever -- if you want to add a new network, you
need to recompile it. You run it whenever you want to get onto a
known wireless network, it finds a network for you and connects to
it, and then it exits. If you're in a cafe and need to figure out
which network to connect to, just scan and configure with ifconfig(8).

Configuration
-------------
Edit config.h and recompile.

autonet assumes that you have files under /etc/hostname.d that are
named like "<ifname>.<network-name>". There must be a corresponding
file for each NetPref defined in config.h, named for either the
filename or, if filename is NULL, the nwid. autonet doesn't check
this for you -- you have to do it yourself.

So for instance if you are using autonet on iwn0 and have a NetPref
with

    { .nwid = "attwifi", .filename = NULL },

there should be a file at /etc/hostname.d/iwn0.attwifi that contains
the hostname.if(5) configuration for the attwifi network. Likewise
if you have

    { .nwid = "whatever", .filename = "mynet" },

/etc/hostname.d/iwn0.mynet should contain the configuration for the
"whatever" network.

autonet looks for networks in the order they're defined in config.h.

Boot-time usage
---------------
autonet may be used to pick your computer's network on boot. A patch
that modifies /etc/rc to do this is included as rc-autonet.patch.