Last active
May 17, 2024 17:11
-
-
Save yene/1e9a271a34ae53342451709378dbbe69 to your computer and use it in GitHub Desktop.
disable AWDL every 10 seconds
This file contains 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 | |
set -e | |
interrupted=false | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
function cleanup() { | |
echo "Script interrupted ..." | |
interrupted=true | |
} | |
trap cleanup SIGINT | |
# every x seconds, disable AWDL | |
while true; do | |
if $interrupted; then | |
break | |
fi | |
if ifconfig awdl0 | grep -q "status: active"; then | |
formatted_date=$(date +'%Y-%m-%d %H:%M:%S') | |
echo "$formatted_date: Disabling AWDL to prevent WiFi channel hoping..." | |
ifconfig awdl0 down | |
fi | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment