适用于Linux操作系统,且该脚本仅在计算机学科楼测试可用
原理:发送带有账户信息的POST
数据包
autoauth.sh
用于填入你的账户信息并发送POST
数据包进行认证操作whether_online.sh
用于判断是否断网,如果断网则执行脚本autoauth.sh
进行联网操作
借助Linux Crontab 定时任务将whether_online.sh
脚本设置为定时任务,每1min
执行一次,即可保证断网时间不超过2min
,参考:
# 每分钟执行一次
* * * * * sh /path/to/whether_online.sh
- 拉取本项目代码
git clone https://github.com/CCCougar/autoReconnect.git
cd autoReconnect
-
在
autoauth.sh
中填入自己的校园网账户信息 -
在
crontab.conf
中输入正确的whether_online.sh
路径 -
注册定时任务
crontab crontab.conf
- NUPT_net_autoauth
- SQL@213