This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Automatically toggle macOS Wi-Fi based on ethernet status (uses launchd). | |
# If ethernet is active, Wi-Fi is disabled. If ethernet is inactive, Wi-Fi is enabled. | |
PATH="/bin:/sbin:/usr/bin:/usr/sbin" | |
LAUNCHD_SERVICE_NAME="nz.haume.wifi-toggle" | |
LAUNCHD_SERVICE_FILE="${HOME}/Library/LaunchAgents/${LAUNCHD_SERVICE_NAME}.plist" | |
DEBUG="yes" |