Network – How to Disable WiFi Automatically if There is an Ethernet Connection

bugethernetNetworkwifi

When I wake my machine in the morning, it often stays blank because there's some conflict between my 4k monitor and the 'Your computer name has changed for the 3950th time' dialogue that means both screens are off until I dismiss the dialogue I can't see.

I don't want to have to turn wifi on and off manually – we have computers to do things automatically for us – and I need a wired connection while I'm at my desk.

So can I tell the Mac only to enable to wifi if eth0 is inactive?

Or turn the 'Your computer name has changed' dialogue into a notification that doesn't need manual dismissal, because I really don't care what number Apple has decided to add to it today?

Best Answer

You have several solutions:

  1. https://gist.github.com/albertbori/1798d88a93175b9da00b

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

  1. https://macperformanceguide.com/blog/2014/20141118_0958-OSX_Yosemite-disable-WIFI.html

  2. The associated google search :

https://www.google.fr/search?client=safari&rls=en&q=disable+wifi+if+ethernet+osx&ie=UTF-8&oe=UTF-8&gfe_rd=cr&ei=VL_cWMj1B-zUXt3CkLAM