栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

湖北工业大学校园网自动认证功能

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

湖北工业大学校园网自动认证功能

湖北工业大学校园网自动认证功能 测试学校:湖北工业大学

校园网 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 okn' > $LOG_PATH
        echo -e 'try to exitn' > $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!rn' $cnt $PING_SUM $SLEEP_SEC >> $LOG_PATH
        printf '-> [%d/%d] Network maybe disconnected,checking again after %d seconds!rn' $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

教育网:空着即可

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1040461.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号