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

来源:互联网 发布:java 对象的大小 编辑:程序博客网 时间:2024/05/22 12:47
#!/bin/shwhile 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 1doneubus call hostapd.wlan0 del_client '{"addr":"48:db:50:d5:e4:a1", "reason": 5, "deauth": True, "ban_time": 1000}'

0 0
原创粉丝点击