├── README.md ├── iwscan └── kickass /README.md: -------------------------------------------------------------------------------- 1 | # kickass 2 | Simple script for OpenWrt to kick weak clients' ass; 3 | Impliment is way too simle, comparing signal strength using string. 4 | 5 | ## Usage 6 | first to install iwinfo package and maybe bash(ash is installed by default) 7 |
opkg install iwinfo
8 | then invoke this script from /etc/rc.local
9 |
10 |
--------------------------------------------------------------------------------
/iwscan:
--------------------------------------------------------------------------------
1 | iw wlan0 scan | grep 'SSID\|signal\|primary'
2 |
--------------------------------------------------------------------------------
/kickass:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | while true;
3 | do
4 | maclist=(`iw dev wlan0 station dump | grep "Station" | cut -f 2 -s -d " "`)
5 | rxlist=(`iw dev wlan0 station dump | grep "signal:" | cut -f 3 -s -d " "`)
6 | #maclist=(`iwinfo wlan0 assoclist | grep "dBm" | cut -f 1 -s -d " "`)
7 | #rxlist=(`iwinfo wlan0 assoclist | grep "dBm" | cut -f 3 -s -d " "`)
8 | rxref="-80" #threshold
9 | len=${#maclist[@]}
10 | for((i=0;i<$len;i++))
11 | do
12 | mac=${maclist[$i]}
13 | rx=${rxlist[$i]}
14 | # here, use string comparation, simple but error prone
15 | if [[ "$rx" > "$rxref" ]]; then
16 | #echo $mac $rx
17 | ubus call hostapd.wlan0 del_client '{"addr":"'"$mac"'", "reason": 5, "deauth": True, "ban_time": 3000}'
18 | #ubus call hostapd.wlan0 list_bans
19 | fi
20 | done
21 | sleep 1
22 | done
23 |
--------------------------------------------------------------------------------