admin管理员组文章数量:1633838
湖北工业大学校园网自动认证功能
测试学校:湖北工业大学
校园网 Srun 深澜认证登录
支持的深澜认证的版本
V1.18 B20190830
V1.18 B20210607
V1.18 B20210909
基于openwrt
定时任务
*/1 * * * * /root/detect_ping.sh > /root/autologin.log 2&>1
detect_ping.sh
这里使用阿里云dns,很奇怪在没有认证的情况下114.114.114.114
的dns可以ping
#ping 的总次数
PING_SUM=3
#ping 的间隔时间,单位秒
SLEEP_SEC=10
#连续重启网卡 REBOOT_CNT 次网络都没有恢复正常,重启软路由
#时间= (SLEEP_SEC * PING_SUM + 20) * REBOOT_CNT
REBOOT_CNT=3
LOG_PATH="/root/autologin.log"
cnt=0
reboot_cnt=0
while :
do
ping -c 1 -W 1 223.5.5.5 > /dev/null
ret=$?
ping -c 1 -W 1 223.6.6.6 > /dev/null
ret2=$?
if [[ $ret -eq 0 || $ret2 -eq 0 ]]
then
echo -e 'net is ok\n' > $LOG_PATH
echo -e 'try to exit\n' > $LOG_PATH
#cnt=0
#reboot_cnt=0
exit
else
cnt=`expr $cnt + 1`
echo -n `date '+%Y-%m-%d %H:%M:%S'` >> $LOG_PATH
printf '-> [%d/%d] Network maybe disconnected,checking again after %d seconds!\r\n' $cnt $PING_SUM $SLEEP_SEC >> $LOG_PATH
printf '-> [%d/%d] Network maybe disconnected,checking again after %d seconds!\r\n' $cnt $PING_SUM $SLEEP_SEC
if [ $cnt == $PING_SUM ]
then
echo 'try to re curl' >> $LOG_PATH
echo 'ifup wan!!!'
sleep 5
/root/sdusrun login -c /root/config.json > /root/autologin.log 2&>1
cnt=0
#重连后,等待10秒再进行ping检测
sleep 8
#网卡重启超过指定次数还没恢复正常,重启软路由
reboot_cnt=`expr $reboot_cnt + 1`
if [ $reboot_cnt == $REBOOT_CNT ]
then
echo -n `date '+%Y-%m-%d %H:%M:%S reboot!'` >> $LOG_PATH
echo '-> Network has some problem, lets reboot' >> $LOG_PATH
echo '-> =============== reboot!'
reboot
fi
fi
fi
sleep $SLEEP_SEC
done
登录配置文件
下载文件
config文件配置参考
需要修改detect_ping.sh
/root/sdusrun login -c /root/config.json > /root/autologin.log 2&>1
更换成自己的目录
需要注意不同学校acid
和type
参数值可能不一样,可以自行用fiddler4
抓包查看
{
"server": "http://202.114.177.246",
"strict_bind": false,
"double_stack": false,
"retry_delay": 3000,
"retry_times": 3,
"n": 200,
"type": 1,
"acid": 1,
"os": "Windows",
"name": "Windows 98",
"users": [
{
"username": "学号@ctcc",
"password": "密码",
"if_name": "eth0.2"
}
]
}
中国电信:ctcc
中国移动:cmcc
中国联通:cucc
教育网:空着即可
版权声明:本文标题:湖北工业大学校园网自动认证功能 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1729175993a1188724.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论