Skip to content

barkure/CSU-Net-Portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSU-Net-Portal

自动登录中南大学校园网,保持校园网登录态。

How to use

主要配置有 USERNAMEPASSWORDTYPE

# USERNAME 为你的学号
# PASSWORD 为你的密码
# TYPE 为运营商类型:1=中国移动, 2=中国联通, 3=中国电信, 4=校园网
# INTERVAL 为自动检测间隔,单位为秒,默认为 10 秒

有如下四个版本:

Shell (Linux)

安装

  1. 克隆到本地并安装脚本和配置文件:
git clone https://github.com/barkure/CSU-Net-Portal.git && cd CSU-Net-Portal
sudo install -D -m 755 shell/linux/csu-autoauth.sh /usr/local/bin/csu-autoauth
sudo install -D -m 644 shell/linux/config.conf.example /usr/local/etc/csu-autoauth/config.conf
  1. 修改配置:
sudo nano /usr/local/etc/csu-autoauth/config.conf
  1. 添加到系统启动项:
sudo cp shell/linux/csu-autoauth.service /etc/systemd/system/csu-autoauth.service
sudo systemctl daemon-reload
sudo systemctl enable --now csu-autoauth.service

其他

- /usr/local/bin/csu-autoauth
- /usr/local/etc/csu-autoauth/config.conf
- /var/log/csu-autoauth/csu-autoauth.log
- /etc/systemd/system/csu-autoauth.service
  • 运行状态:
sudo systemctl status csu-autoauth.service
  • 查看日志:
sudo journalctl -u csu-autoauth.service -f

Shell (macOS)

安装

  1. 克隆到本地:
git clone https://github.com/barkure/CSU-Net-Portal.git && cd CSU-Net-Portal
  1. 修改配置模板:
nano shell/macos/config.conf.example
  1. 安装 launchd 服务:
sh shell/macos/install-launchd.sh

其他

  • 该脚本会自动创建:
- ~/.local/bin/csu-autoauth
- ~/.config/csu-autoauth/config.conf
- ~/Library/Logs/csu-autoauth/
- ~/Library/LaunchAgents/com.barkure.csu-autoauth.plist
  • 卸载服务:
sh shell/macos/uninstall-launchd.sh
  • 脚本默认日志文件:
- ~/Library/Logs/csu-autoauth/csu-autoauth.log
- ~/Library/Logs/csu-autoauth/launchd.out.log
- ~/Library/Logs/csu-autoauth/launchd.err.log

PowerShell

安装

  1. 克隆到本地:
git clone https://github.com/barkure/CSU-Net-Portal.git; cd .\CSU-Net-Portal
  1. 修改配置模板:
notepad .\powershell\config.ps1.example
  1. 安装并启用自启动:
powershell -ExecutionPolicy Bypass -File .\powershell\install-startup.ps1

其他

  • 该脚本会自动创建:
- $HOME\csu-autoauth.ps1
- $HOME\.config\csu-autoauth\config.ps1
  • 取消自启并即刻停止:
powershell -ExecutionPolicy Bypass -File .\powershell\uninstall-startup.ps1
  • 默认日志文件:$env:LOCALAPPDATA\csu-autoauth\csu-autoauth.log

OpenWrt

请在仓库的 Release 页面下载与你设备架构和 OpenWrt 版本匹配的安装包,再上传到路由器安装。

OpenWrt 目前使用新的包管理器 apk 替换了 opkg,请使用对应的包管理器进行安装:

  • OpenWrt 25.12+ 使用 apk
scp -O ./csu-autoauth-*.apk root@<router-ip>:/tmp/csu-autoauth.apk
ssh root@<router-ip> apk add --allow-untrusted /tmp/csu-autoauth.apk
  • OpenWrt 24.10 及更早版本使用 opkg
scp -O ./csu-autoauth-*.ipk root@<router-ip>:/tmp/csu-autoauth.ipk
ssh root@<router-ip> opkg install /tmp/csu-autoauth.ipk

安装完成后,使用 UCI 配置账号密码:

uci set csu-autoauth.main.username='USERNAME'
uci set csu-autoauth.main.password='PASSWORD'
uci set csu-autoauth.main.type='TYPE'
uci set csu-autoauth.main.interval='10'
uci commit csu-autoauth
/etc/init.d/csu-autoauth restart

如果仓库软件源可用,包管理器会自动拉取 curl;如果软件源不可用,需要先确保路由器能访问对应软件源,或提前准备好离线的依赖包一并安装。

OpenWrt 包版本维护约定:

  • 程序逻辑变化 -> bump PKG_VERSION, reset PKG_RELEASE to 1
  • 仅打包变化 -> bump PKG_RELEASE only
  • 仅文档变化 -> no version bump

About

自动登录中南大学校园网,保持校园网登录态

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors