After building the openssh server/client and rsync (
see this post), I needed an easy way to start and stop wifi from scripts so I can make syncing scripts that connect to the internet all by themselves. I took apart onyx's "device server" and, without claiming I know what I am doing

, I hacked a program for doing just that.
To get wifi up do:
wifi_primitive -up
To bring it down do:
wifi_primitive -down
To bring wifi up, run a single command and bring it down, do;
wifi_primitive -c <command>
As usual, the program is thoroughly untested

i.e., use at your own risk.