mtk7688之openwrt wifi热点搜索脚本
最近由于各种原因,导致更新的帖子没有之前那么多,经常我们需要查看WIFI信息,但是如果一条一条在终端敲未免太繁琐,于是乎shell脚本就很好的解决了我们的问题,比如我们需要搜索周边环境的WIFI热点,我们就可以在openwrt终端中vi scanap.sh的脚本,chmod +x scanap.sh,在脚本下面输入如下指令就可以实现功能
#!/bin/sh
clear
echo "wateras's wifi ap scan"
echo "Begin scaning APs, pls wait..."
iwpriv ra0 set SiteSurvey=1
sleep 1
echo "wifi scan start!!!!!!"
echo "APs available are..."
iwpriv ra0 get_site_survey
其实我使用的op固件已经支持了ap的扫描功能,直接用就是,不过随着我们深入的学习不可能永远拿别人的修改过的op固件来玩,终有一天要自己出师的,了解实现的机制还是有必要的,别人的终究是别人的,未必最终是自己的,他山之石可以攻玉固然好,不过别人的孩子再好也比不过亲生的好,有些东西及时再过千年也还是这样的道理。
运行结果:
root@Widora:/# vi scanap.sh
root@Widora:/# chmod +x scanap.sh
root@Widora:/# ./scanap.sh
wateras's wifi ap scan
Begin scaning APs, pls wait...
wifi scan start!!!!!!
APs available are...
ra0 get_site_survey:
Ch SSID BSSID Security Signal(%)W-Mode ExtCH NT WPS DPID
6 303303 28:2c:b2:89:4d:28 WPA1PSKWPA2PSK/AES 100 11b/g/n BELOW In YES
8 HUAWEI-B315-12AB 80:13:82:32:12:ab WPA2PSK/AES 60 11b/g/n NONE In NO
1 TAKJ_2.4G 8a:25:93:c0:65:10 WPA2PSK/AES 26 11b/g/n ABOVE In NO
1 HUAWEI P10 Plus 0c:8f:ff:94:17:03 WPA2PSK/AES 24 11b/g/n NONE In NO
1 TESOL-BJ 24:69:68:c8:ce:8c WPA1PSKWPA2PSK/AES 20 11b/g/n ABOVE In NO
6 706 bc:d1:77:7d:5c:2a WPA1PSKWPA2PSK/AES 0 11b/g/n ABOVE In YES
12 rui 2c:30:33:60:4d:2f WPA2PSK/AES 70 11b/g/n NONE In YES
op原有的ap扫描结果如下:
root@Widora:/# aps
Widora AP scan.
ra0 get_site_survey:
Ch SSID BSSID Security Signal(%)W-Mode ExtCH NT WPS DPID
6 303303 28:2c:b2:89:4d:28 WPA1PSKWPA2PSK/AES 100 11b/g/n BELOW In YES
10 HUAWEI-B315-12AB 80:13:82:32:12:ab WPA2PSK/AES 76 11b/g/n NONE In NO
12 rui 2c:30:33:60:4d:2f WPA2PSK/AES 76 11b/g/n NONE In YES
1 TAKJ_2.4G 8a:25:93:c0:65:10 WPA2PSK/AES 23 11b/g/n ABOVE In NO
1 TESOL-BJ 24:69:68:c8:ce:8c WPA1PSKWPA2PSK/AES 20 11b/g/n ABOVE In NO
1 bjmnxwm2013 2c:e6:cc:3c:87:58 WPA2PSK/AES 15 11b/g/n NONE In NO
5 HUAWEI-B315-A88A c4:86:e9:67:a8:8a WPA2PSK/AES 2 11b/g/n NONE In NO
此内容由EEWORLD论坛网友wateras1原创,如需转载或用于商业用途需征得作者同意并注明出处