Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5
🌐 A headless login / logout CLI for gateway (10.0.0.55) at BIT, now in Rust. 北京理工大学 10.0.0.55 校园网登录登出的 Rust 实现
License
spencerwooo/bitsrun-rs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
🌐 A headless login and logout CLI for gateway (10.0.0.55) at BIT, now in Rust.
curl -fsSL https://cdn.jsdelivr.net/gh/spencerwooo/bitsrun-rs@main/install.sh | sh -
- Download the latest
.debpackage fromReleases. sudo apt install </path/to/file>.deb
Ifbitsrun.service systemd service required:
- Edit
/lib/systemd/system/bitsrun.serviceto specify absolute config path - Then start service with
sudo systemctl start bitsrun
cargo install bitsrun
- Download the latest binary fromReleases.
- Uncompress file:
tar -xvf <file>.tar.gz - Move binary to
$PATH, such as:mv <file>/bitsrun ~/.local/bin/
To log into or out of the campus network, simply:
$bitsrun login -u<username> -p<password>bitsrun: <ip> (<username>) logged in$bitsrunlogout -u<username>bitsrun: <ip> logged out
To check device login status:
$bitsrun statusbitsrun: <ip> (<username>) is online┌────────────────┬───────────────┬───────────────┬─────────┐│ Traffic Used │ Online Time │ User Balance │ Wallet │├────────────────┼───────────────┼───────────────┼─────────┤│ 188.10 GiB │ 2 months │ 10.00 │ 0.00 │└────────────────┴───────────────┴───────────────┴─────────┘
To keep the session alive, usebitsrun keep-alive:
$bitsrun keep-alive INFO bitsrun::daemon > starting daemon (<username>) with polling interval=3600s INFO bitsrun::daemon > <ip> (<username>): login success, ... ^C INFO bitsrun::daemon > <username>: gracefully exiting
Note
Use available system service managers to runbitsrun keep-alive as a daemon. (e.g.,systemd for Linux,launchd for macOS, and Windows Service for Windows).
$bitsrun --helpA headless login and logout CLI for 10.0.0.55 at BITUsage: bitsrun [OPTIONS] [COMMAND]Commands: login Login to the campus network logout Logout from the campus network status Check device login status config-paths List all possible config file paths keep-alive Poll the server with login requests to keep the session alive help Print this message or the help of the given subcommand(s)Options: -v, --verbose Verbose output -h, --help Print help -V, --version Print version
Tip
Use environment variableNO_COLOR=true to disable colored output.
To save your credentials and configurations, create config filebit-user.json under an available config path as:
{"username":"<username>","password":"<password>","dm":true,"poll_interval":3600}dmis for specifying whether the current device is a dumb terminal, and requires logging out through the alternative endpoint. Set totrue(no quotes!) if the device you are working with is a dumb terminal.poll_intervalis an optional field for specifying the interval (in seconds) of polling login requests. Default is3600seconds (1 hour). Used bybitsrun keep-aliveonly.
Available config file paths can be listed with:
$bitsrun config-pathsbitsrun: list of possible config paths┌──────────┬─────────────────────────────────────────────────────────────┐│ Priority │ Possible Config Path │├──────────┼─────────────────────────────────────────────────────────────┤│ 1 │ /Users/spencerwoo/.config/bit-user.json ││ 2 │ /Users/spencerwoo/.config/bitsrun/bit-user.json ││ 3 │ /Users/spencerwoo/Library/Preferences/bitsrun/bit-user.json ││ 4 │ bit-user.json │└──────────┴─────────────────────────────────────────────────────────────┘
Note
The config file location is OS-dependent. Run the command to check the accepted locations on your system.
Set permissions of this file to600 on Linux and macOS, orbitsrun will refuse to read it.
$chmod 600<path/to/bit-user.json>zu1k/srun- Srun authentication system login tools. (Rust)Mmx233/BitSrunLoginGo- 深澜校园网登录脚本 Go 语言版 (Go)vouv/srun- An efficient client for BIT campus network. (Go)BITNP/bitsrun- A headless login / logout script for 10.0.0.55 at BIT. (Python)
About
🌐 A headless login / logout CLI for gateway (10.0.0.55) at BIT, now in Rust. 北京理工大学 10.0.0.55 校园网登录登出的 Rust 实现
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.
