Network preferences will not open
Q: "How can I force airport to die?"
You can disable Wi-Fi (aka "AirPort") by using the networksetup
command.
In order to do this, you have to know which "en" port AirPort is using. Usually it is either en0 or en1. You can find out for sure by using this command:
networksetup -listnetworkserviceorder
and looking at the output.
For example, here is the output of that command on my MacBook Air:
An asterisk (*) denotes that a network service is disabled.
(1) Bluetooth DUN
(Hardware Port: Bluetooth DUN, Device: Bluetooth-Modem)
(2) USB Ethernet
(Hardware Port: USB Ethernet, Device: en2)
(3) Wi-Fi
(Hardware Port: Wi-Fi, Device: en0)
(4) Bluetooth PAN
(Hardware Port: Bluetooth PAN, Device: en1)
As you can see in the third entry, mine is 'en0'. Therefore, to turn off Wi-Fi on my Mac, I use the command:
sudo networksetup -setairportpower en0 off
turning it back on again, as you might expect:
sudo networksetup -setairportpower en0 on
Note that I am on 10.9 and so things may be slightly different, but I do not think they will be significant. At one point Mac OS X's networksetup
command may have referred to this as "AirPort" instead of "Wi-Fi" but I think that was back in Snow Leopard (10.6).