This repository contains scripts and configurations to automate the switching between Wi-Fi and Ethernet connections on macOS based on the status of the Ethernet connection. The work is inspired by and builds upon a gist by GitHub user albertbori.
toggleAirport.sh
: A script that monitors the status of Ethernet and Wi-Fi connections, and switches between them as necessary.com.mine.toggleairport.plist
: A LaunchAgent plist file that macOS uses to execute thetoggleAirport.sh
script.setup.sh
: A script that automates the process of deploying thetoggleAirport.sh
script andcom.mine.toggleairport.plist
on your macOS system.
- Clone the repository to your local system.
- Navigate into the repository directory.
- Run
setup.sh
withsudo
to set up the system:This script will modify the plist file to include the current user, move the necessary files to their appropriate locations, update permissions, and register the LaunchAgent with macOS.sudo ./setup.sh
Once you've set up the scripts and configurations, your macOS system will automatically switch between Wi-Fi and Ethernet connections based on the status of the Ethernet connection.
If the Ethernet connection is active, the system will turn off Wi-Fi and use the Ethernet connection. If the Ethernet connection becomes inactive, the system will switch back to the Wi-Fi connection.
This work is inspired by and builds upon a gist by GitHub user albertbori.
Please use these scripts and configurations at your own risk. Always review and understand the scripts before executing them on your system.