I have forked your repo and made the changes. Library/Preferences/SystemConfiguration/.plist Library/Preferences/SystemConfiguration/ist Sadly I don't have a machine on Mojave to test with. Interesting, it seems that Apple changes the way the system responds to plugging in and removing ethernet adapters in Catalina. When unplugging, it always enables Wifi correctly. When I disable Wifi manually, the "Wired connection detected" notification appears.
#Back to my mac ethernet connection pro#
Used it on Mojave on a 2015 MacBook Pro with a Thunderbolt Ethernet Adapter (Interface number below 10) and it does not turn Wifi off, when adapter is plugged in again.
#Back to my mac ethernet connection install#
(Had to install as admin but not with sudo, our users dont have administrative privileges) I organized all the fixes and put it here: # Determine whether ethernet status changed "./statusChanged.sh " " $eth_status " " $air_status " & If ( & ) thenĪir_status= `/usr/sbin/networksetup -getairportpower $air_name | awk ' ' ` # If file prev_eth_on exists, ethernet was active last time we checked *Ethernet, Device: (en.)\)$|\1|p ' `Īir_name= `networksetup -listnetworkserviceorder | sed -En 's/^\(Hardware Port: (Wi-Fi|AirPort), Device: (en.)\)$/\2/p ' ` We assume here that any ethernet connection name ends in "Ethernet"Įth_names= `networksetup -listnetworkserviceorder | sed -En 's|^\(Hardware Port. Osascript -e "display notification \" $1 \" with title \"Wifi Toggle \" sound name \"Hero \" " usr/local/bin/growlnotify -m " $1 " -a "AirPort Utility.app " usr/sbin/networksetup -setairportpower $air_name off usr/sbin/networksetup -setairportpower $air_name on To debug, just run: sudo /Library/Scripts/toggleAirport.sh and add echo's wherever you'd like Delete /Library/Scripts/toggleAirport.sh.Run sudo launchctl unload /Library/LaunchAgents/ to stop the watcher.
Run sudo launchctl load /Library/LaunchAgents/ to start the watcher.Run chmod 755 /Library/Scripts/toggleAirport.sh.Copy toggleAirport.sh to /Library/Scripts/.Most the credit for these changes go to Dave Holland. Feel free to fork and fix any issues you encounter. I did, however, add OSX notification center support. It's supposed to support growl, but I didn't check that part. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. If you decide to turn wifi on for whatever reason, it will remember that choice. 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.