一个用于自动登录校园网的命令行工具,支持自动重连和状态监控。
- 🔐 自动登录校园网
- 📊 查看用户信息和流量统计
- 🔄 自动监控和重连功能
- 📝 详细的日志记录
- ⚙️ 支持配置文件和命令行参数
git clone https://github.com/wyfhbb/BUCT-Login.git
cd buct-login
go build -o buct-login main.go./buct-login -action=login -username=你的学号 -password=你的密码./buct-login -action=info./buct-login -action=logout./buct-login -action=monitor -username=你的学号 -password=你的密码生成配置文件模板:
./buct-login -generate-config=config.json使用配置文件:
./buct-login -config=config.json配置文件示例:
{
"username": "your_student_id",
"password": "your_password",
"action": "monitor",
"monitor_interval": 60,
"retry_interval": 5,
"log_file": "buct-login.log",
"quiet": false,
"no_log": false
}| 参数 | 说明 | 默认值 |
|---|---|---|
-action |
操作类型:login/info/logout/monitor |
- |
-username |
用户名 | - |
-password |
密码 | - |
-config |
配置文件路径 | - |
-monitor-interval |
监控间隔(秒) | 60 |
-retry-interval |
重试间隔(秒) | 5 |
-logfile |
日志文件路径 | buct-login.log |
-nolog |
不保存日志文件 | false |
-quiet |
静默模式 | false |
后台运行监控模式:
nohup ./buct-login -action=monitor -username=yourID -password=yourpass > /dev/null 2>&1 &使用自定义监控间隔:
./buct-login -action=monitor -username=yourID -password=yourpass -monitor-interval=30- 首次使用请确保网络环境正确
- 监控模式下程序会持续运行,建议在后台执行
- 日志文件会记录详细的操作信息,便于问题排查
- 注意:该工具仅供学习和研究使用,请勿用于非法用途。使用前请确保遵守学校的网络使用规定。
MIT License