Last active
August 29, 2015 14:12
-
-
Save devsli/a71de2a51c78828f5437 to your computer and use it in GitHub Desktop.
OpenWRT WiFi channel checker
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/sh | |
CURRENT=$(uci get wireless.radio0.channel) | |
HOST=$(echo $SSH_CONNECTION | awk '{print $1}') # host to ping | |
echo "Initial channel: $CURRENT" | |
set_channel() | |
{ | |
uci set wireless.radio0.channel=$1 | |
uci commit | |
wifi | |
echo "Channel $1" | |
} | |
ping_test() | |
{ | |
ping -q -c 30 $HOST | grep round-trip | |
} | |
for CHANNEL in $(seq 1 11) | |
do | |
set_channel $CHANNEL | |
ping_test | |
done | |
set_channel $CURRENT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment