Repository: meterup/awdl_wifi_scripts Branch: main Commit: 92b311662e9b Files: 8 Total size: 3.9 KB Directory structure: gitextract_bqhd4pi6/ ├── LICENSE ├── README.md ├── awdl-daemon.sh ├── awdl.sh ├── cleanup-and-reenable-awdl.sh ├── com.meter.wifi.awdl.plist ├── disable_awdl.sh └── disable_disable_awdl.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2022 Meter, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ See https://www.meter.com/mac-osx-awdl-psa for more context. This script will disable AWDL (Apple Wireless Direct Link) in order to improve WiFi connectivity for Apple M1/M2 MacBooks. # Usage ## Run it one time 1. On your Mac, open the Terminal app. 2. Run: ```bash <(curl -sL https://www.meter.com/awdl.sh)``` 3. Acknowledge the prompt and type in your admin password. ## Run it automatically after a restart. 1. On your Mac, open the Terminal app. 2. Run: ```curl -sL https://www.meter.com/awdl-daemon.sh | bash``` ## Remove the scripts and renable awdl0 interface ``` curl -s https://raw.githubusercontent.com/meterup/awdl_wifi_scripts/main/cleanup-and-reenable-awdl.sh | bash &> /dev/null ``` ================================================ FILE: awdl-daemon.sh ================================================ #!/bin/bash curl -s https://raw.githubusercontent.com/meterup/awdl_wifi_scripts/main/disable_awdl.sh > ~/disable_awdl.sh sudo chmod u+x ~/disable_awdl.sh cd /Library/LaunchDaemons/ && sudo curl -sO https://raw.githubusercontent.com/meterup/awdl_wifi_scripts/main/com.meter.wifi.awdl.plist sudo sed -i -- "s/YOUR_USERNAME/${USER}/g" /Library/LaunchDaemons/com.meter.wifi.awdl.plist sudo launchctl unload -w /Library/LaunchDaemons/com.meter.wifi.awdl.plist 2> /dev/null sudo launchctl load -w /Library/LaunchDaemons/com.meter.wifi.awdl.plist ================================================ FILE: awdl.sh ================================================ #!/usr/bin/env bash read -p "See https://www.meter.com/mac-osx-awdl-psa for more details. You will be prompted for your admin password. Do you want to continue? y/n" choice case $choice in [yY]* ) sudo echo "Installing disable_awdl.sh in your tmp directory. This will run in the background." ;; [nN]* ) exit ;; *) exit ;; esac curl -s https://raw.githubusercontent.com/meterup/awdl_wifi_scripts/main/disable_awdl.sh > /tmp/disable_awdl.sh chmod u+x /tmp/disable_awdl.sh sudo bash /tmp/disable_awdl.sh > /dev/null & ================================================ FILE: cleanup-and-reenable-awdl.sh ================================================ #!/bin/bash sudo launchctl unload -w /Library/LaunchDaemons/com.meter.wifi.awdl.plist sudo rm /Library/LaunchDaemons/com.meter.wifi.awdl.plist* sudo pkill -f /tmp/disable_awdl.sh sudo pkill -f ~/disable_awdl.sh sudo rm /tmp/disable_awdl.sh rm ~/disable_awdl.sh sudo ifconfig awdl0 up ================================================ FILE: com.meter.wifi.awdl.plist ================================================ Label com.meter.wifi.awdl ProgramArguments /Users/YOUR_USERNAME/disable_awdl.sh RunAtLoad ================================================ FILE: disable_awdl.sh ================================================ #!/usr/bin/env bash set -euo pipefail while true; do if ifconfig awdl0 |grep -q "