OPENWRT根据连接设备MAC实现WIFI打卡、签到(基于PHP)
<?php print("<table border=\"1\">"); $RSLT=shell_exec('cat /proc/net/arp'); //判断队列 $STU_UN=""; $STU_INFOR="<tr><th><strong>已签到学生</strong></th> <th><strong>学号</strong></th> </tr> <br>"; if (strpos($RSLT, "6c:88:14:fc:dd:20") !== false) {$STU_INFOR=$STU_INFOR."<tr><td>测试学生1</th> <td>100</th> </tr> <br>";} else {$STU_UN=$STU_UN."<tr><td>测试学生1</th> <td>100</th> </tr> <br>";} if (strpos($RSLT, "b0:eb:57:05:15:d7") !== false) {$STU_INFOR=$STU_INFOR."<tr><td>测试学生2</th> <td>101</th> </tr> <br>";} else {$STU_UN=$STU_UN."<tr><td>测试学生2</th> <td>101</th> </tr> <br>";} if (strpos($RSLT, "6C:88:14:FC:DD:22") !== false) {$STU_INFOR=$STU_INFOR."<tr><td>测试学生3</th> <td>102</th> </tr> <br>";} else {$STU_UN=$STU_UN."<tr><td>测试学生3</th> <td>102</th> </tr> <br>";} print($STU_INFOR); print("<br><tr><th><strong>未签到学生</strong></th> <th><strong>学号</strong></th> </tr> <br>"); print($STU_UN."</table>"); ?>
OPENWRT编译过程:
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev
接下来运行
mkdir openwrt 创建一个openwrt文件夹cd openwrt 进入openwrt文件夹svn co svn://svn.openwrt.org/openwrt/branches/backfire下载官网的源码(稳定版本) 或者 svn co svn://svn.openwrt.org/openwrt/trunk下载官网的源码(测试版本) PS:(稳定版本,测试版本任选一个) ./scripts/feeds update -a 更新软件包./scripts/feeds install -a 安装软件包 PS: 下载更新过程根据网速决定
接下来选择芯片信息,之后开始编译
make V=99