Skip to content

wengzhe/thu-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THU-Auth

  • 由于2018.4.2发现有线网需要使用全新的auth4.tsinghua.edu.cn进行认证,故新写了认证脚本。
  • 2019.6.16发现IPv6也开始过滤MAC了,因此增加了auth6_cmd.py专用于auth6.tsinghua.edu.cn,如果IPv4和IPv6使用同一个MAC地址,则只需运行其中一个即可。

配置

  • cp config/account.example.yaml config/account.yaml
  • 修改config/account.yaml里面的账号配置。

运行

  • 版本Python 3
  • 依赖sudo -H pip3 install -r requirements.txt
  • 请在当前目录下运行,或者修改load_config()path参数。

auth.py

  • 完整的认证代码,只支持上线操作,会通过获取页面自动判断是否在线,鲁棒性较好。
  • 定义在auth.py最前面的login_url会全部被尝试,目前IPv6并不需要登陆,故注释掉了。
  • 执行:./auth.py

auth_cmd.py

  • 精简的认证代码,针对当前版本进行精简,只进行IPv4登陆,并且不判断当前网络状况。
  • 由参数控制登入登出
  • 执行:./auth_cmd.py login./auth_cmd.py logout

版本

  • 长期维护中(~2020)
  • 2018.6.16