mrdomino / autonet Goto Github PK
View Code? Open in Web Editor NEW(DEPRECATED: use ifconfig(8) join instead) Simple wifi chooser for OpenBSD
(DEPRECATED: use ifconfig(8) join instead) Simple wifi chooser for OpenBSD
$OpenBSD: README.template,v 1.5 2016/08/27 09:47:26 ajacoutot Exp $ +------------------------------------------------------------------------------- | Running ${FULLPKGNAME} on OpenBSD +------------------------------------------------------------------------------- autonet is a simple wifi network chooser for OpenBSD. Installation ============ Clone the repo as /usr/ports/mystuff/net/autonet. Then run: 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.
Seems like it'd be useful to have this in ports. I can't find an example of using BSD-style makefiles for a port though, and it doesn't quite work to do it the obvious way.
This issue would make autonet clear things like chan and wpakey in addition to BSSID when it switches to a new profile. My current workaround is to just put -wpakey
in hostname.if(5) files for open networks, but if I ever manually configure a channel, what generally happens is I forget I've done this, get confused when I can't connect to a new network, reboot, and realize what I did after everything works.
If you connect to a profile with a specific bssid followed by one with BSSID_ANY, the bssid isn't reset by netstart. Probably there should be some documentation for how to reset the bssid in a hostname.if file.
I could pay some complexity and remove the need to recompile autonet every time you create a new profile if I just parsed the hostname.if(5) files under /etc/hostname.d at runtime.
Unfortunately the only parser I can find for hostname.if(5) files is written in Bourne shell and named /etc/netstart. But I suppose it wouldn't be too bad to grep for "^nwid", "^bssid", etc. and parse those values. I wonder what happens if an nwid is quoted and contains a newline...
If I don't .include Makefile.inc, then it is included 0 times and thus things fail to compile. If I do .include it, then it is included twice. Things still compile, but all flags are passed twice.
Probably a result of abusing bsd.*.mk.
If the input nwid has quotes around it, then netpref-line shouldn't add extra quotes when it C-escapes it.
Currently it's in autonet/Makefile and uses wacky full paths. I don't yet understand the bsd.*.mk setup well enough to know the reasonable way to do it.
Right now IFNAME is a preprocessor macro. This would make it a configurable option, allowing you to use autonet
on multiple different interfaces.
I have never needed this. If you want it, say so in this issue.
We could use this at boot time, relying on netstart happening on its own later.
This would add a -p
flag that would just force-connect to the named profile without bothering to do a scan. Could be useful for connecting to networks that don't advertise.
This is probably easily exploitable unless I sanity-check the input, and I've never needed it, but if you want it, say so here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.