To control the network settings with the command line try:
networksetup -listnetworkserviceorder
Then:
To display current state of wireless:
networksetup -getairportpower <device name>
Or to turn wireless off or on:
networksetup -setairportpower <device name> <on off>
For a longer description of these see: