A command-line tool to login ZWU(浙江万里学院) net services, especially for headless devices. Written in Golang
- Download
zwu_$PLATFORM_$ARCH
from GitHub release - Rename it to
zwu
- (*Unix only)
chmod a+x ./zwu
- Parsing zwu.toml file and login:
./zwu [-f]
- Login:
./zwu [-f] -u <username> -p <password>
- Logout:
./zwu -L
- Status:
./zwu -S
- Create zwu.toml template file:
./zwu -C
- Parsing zwu.toml and run in daemon mode:
./zwu -D
- Help:
./zwu -h
It is better to generate it by ./zwu -C
rather then write it by you own!!
[config]
Randomize = false
IntervalMinutes = 5
ChangeOnHours = 0
ChangeOnGB = 0.0
[[user]]
Enabled = false
Username = 'username 1'
Password = 'password 1'
[[user]]
Enabled = false
Username = 'username 2'
Password = 'password 2'
./zwu -C
to create zwu.toml template file- Modify
./zwu.toml
file ./zwu -D
to run Daemon mode
Create file /etc/systemd/system/zwu.service
# /etc/systemd/system/zwu.service
[Unit]
Description=zwu_login
After=network.target
[Service]
ExecStart=/root/zwu -u <username> -p <password>
Create file /etc/systemd/system/zwu.timer
# /etc/systemd/system/zwu.timer
[Unit]
Description=zwu Timer
[Timer]
OnCalendar=hourly
OnBootSec=10sec
Unit=zwu.service
[Install]
WantedBy=timers.target
Create file systemdtl enable --now zwu.timer