您的位置:首页 > 其它

[置顶] AR系列高通芯片通过调用ubus来处理连接客户端的问题

2017-05-08 09:47 531 查看
#!/bin/sh
while true;
do
maclist=`iw dev wlan0 station dump | grep "Station" | cut -f 2 -s -d " "`
len=`iw dev wlan0 station dump | grep "Station" | cut -f 2 -s -d " " |wc -l`
rxlist=`iw dev wlan0 station dump | grep "signal:" | cut -f 3 -s -d " "`
#maclist=`iwinfo wlan0 assoclist | grep "dBm" | cut -f 1 -s -d " "`
#rxlist=`iwinfo wlan0 assoclist | grep "dBm" | cut -f 3 -s -d " "`
rxref="-80"  #threshold
len=`iw dev wlan0 station dump | grep "Station" | cut -f 2 -s -d " " |wc -l`
#       len=${#maclist[@]}
echo $len
for((i=0;i<$len;i++))
do
mac=${maclist[$i]}
rx=${rxlist[$i]}
# here, use string comparation, simple but error prone
if [[ "$rx" > "$rxref" ]]; then
echo "$mac  ------> $rx"
ubus call hostapd.wlan0 del_client '{"addr":"'"$mac"'", "reason": 5, "deauth": True, "ban_time": 3000}'
#ubus call hostapd.wlan0 list_bans
fi
done
sleep 1
done

ubus call hostapd.wlan0 del_client '{"addr":"48:db:50:d5:e4:a1", "reason": 5, "deauth": True, "ban_time": 1000}'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐