Skip to content

Instantly share code, notes, and snippets.

@yene
Last active May 17, 2024 17:11
Show Gist options
  • Save yene/1e9a271a34ae53342451709378dbbe69 to your computer and use it in GitHub Desktop.
Save yene/1e9a271a34ae53342451709378dbbe69 to your computer and use it in GitHub Desktop.
disable AWDL every 10 seconds
#!/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