Login, keep login or logout from Internet securely in Nanjing University.
南京大学校园网安全登录登出脚本。可选择一次性登录登出、在前台或后台保持登录、定时登出。
The script uses a portal API with the https protocol, which still works so far (2023.3).
The passwords are read directly from tty without echo, instead of command line arguments or python files, preventing the secure issues in some other scripts.
Install requests.
python3 -m pip install requests
python3 main.py login
python3 main.py logout
python3 main.py keep
python3 main.py keep --tstp; bg; disown
or simply
. ./keep
Please note the dots and the spaces above.
python3 main.py keep --tstp --duration 24; bg; disown
or simply
. ./keep --duration 24
Please note the dots and the spaces above.
More optins can be found in the help message of the script.
After running install.sh
, you can replace python3 main.py
with internet
in all of the commands.