Skip to content
ChrisKimZHTPublic

About

CQU Campus Network Login Script

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

cqu-login

一键登录重庆大学校园网的简易脚本,脚本通过向 http://login.cqu.edu.cn:801/eportal/portal/login 接口发送请求完成登陆。

  • cqu-login.ps1:适用于 Windows 的 PowerShell 脚本,右键运行。
  • cqu-login.sh:适用于 Linux 的 Bash 脚本,指令运行,结合 crontab 可完成守护。

配置

运行前请先修改脚本中的账号、密码和网卡名称。

cqu-login.ps1

由于 Windows 特性,请使用 GB2312 编码打开和保存,避免出现中文乱码。

# ======== Configuration ========
$username = "Please enter your username here"
$password = "Please enter your password here"
$interface = "以太网"
# ===============================

cqu-login.sh

# ======== Configuration ========
USERNAME="Please enter your username here"
PASSWORD="Please enter your password here"
INTERFACE="eth0"
# ===============================

守护

Linux 可使用 crontab 做简单守护,每分钟探测一次连通性,适合挂到路由器上的场景:

* * * * * curl --connect-timeout 10 https://www.baidu.com || bash /path/to/your/cqu-login.sh

Windows 没有比较优雅的守护方式,得创建计划任务,此处省略。

About

CQU Campus Network Login Script

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Contributors

Languages