Turn airport on and off from the command line

sudo networksetup -setairportpower on
sudo networksetup -setairportpower off
man networksetup