Commandline method to switch network connection on and off in OSX

Viewed 625

I frequently tether using my iPhone using a Wifi Hotspot and every once in a while the connection stops working. To fix this, I have to enable and disable the hotspot and then enable/disable the Wifi on the MBP (OSX 10.8.3).

I was hoping to automate this on the MBP. Would you know of a command line way to do this ? The command should switch the wifi off (if it's on) and then switch it back on (slightly different from simply toggling the Wifi connection).

Thanks !!

1 Answers
Related