{"slug": "automatically-disable-wifi-when-an-ethernet-connection-cable-is-plugged-in-on-a", "title": "Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac", "summary": "This article describes a bash script for Mac OSX 10+ that automatically disables Wi-Fi when an Ethernet cable is connected and re-enables it when the cable is disconnected. The script, which requires administrator privileges to install and run, supports OSX Notification Center and is designed to work without hard-coding adapter names. Installation involves copying the script and a plist file to specific directories, setting permissions, and loading the plist as a launch agent.", "body_md": "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.\nMost the credit for these changes go to Dave Holland.\n- Mac OSX 10+\n- Administrator privileges\n- Copy\ntoggleAirport.sh\nto/Library/Scripts/\n- Run\nchmod 755 /Library/Scripts/toggleAirport.sh\n- Copy\ncom.mine.toggleairport.plist\nto/Library/LaunchAgents/\n- Run\nchmod 600 /Library/LaunchAgents/com.mine.toggleairport.plist\n- Run\nsudo launchctl load /Library/LaunchAgents/com.mine.toggleairport.plist\nto start the watcher\n- Run\nsudo launchctl unload /Library/LaunchAgents/com.mine.toggleairport.plist\nto stop the watcher - Delete\n/Library/Scripts/toggleAirport.sh\n- Delete\n/Library/LaunchAgents/com.mine.toggleairport.plist\n- Delete\n/private/var/tmp/prev_eth_on\n- Delete\n/private/var/tmp/prev_air_on\nTo debug, just run: sudo /Library/Scripts/toggleAirport.sh\nand add echo's wherever you'd like", "url": "https://wpnews.pro/news/automatically-disable-wifi-when-an-ethernet-connection-cable-is-plugged-in-on-a", "canonical_source": "https://gist.github.com/albertbori/1798d88a93175b9da00b", "published_at": "2014-10-31 21:42:53+00:00", "updated_at": "2026-05-23 05:06:14.558335+00:00", "lang": "en", "topics": [], "entities": ["Dave Holland", "Mac OSX", "Yosemite"], "alternates": {"html": "https://wpnews.pro/news/automatically-disable-wifi-when-an-ethernet-connection-cable-is-plugged-in-on-a", "markdown": "https://wpnews.pro/news/automatically-disable-wifi-when-an-ethernet-connection-cable-is-plugged-in-on-a.md", "text": "https://wpnews.pro/news/automatically-disable-wifi-when-an-ethernet-connection-cable-is-plugged-in-on-a.txt", "jsonld": "https://wpnews.pro/news/automatically-disable-wifi-when-an-ethernet-connection-cable-is-plugged-in-on-a.jsonld"}}