Last active
May 6, 2022 01:21
-
-
Save nonefffds/bd91a9a2fc7a093edeb56d548560378c to your computer and use it in GitHub Desktop.
Autologin to school network (自动登录学校校园网)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
while true; | |
do if ping -c 1 baidu.com >/dev/null 2>&1 ; then | |
sleep 30 | |
else | |
srun-cli -u <USERNAME> -k <PASSWORD> | |
fi | |
sleep 1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用环境&需求:
环境:x64 ikuai,docker (w/ Python-alpine)
需求:Python3,srun-cli
安装 srun-cli:
pip install srun-cli
使用方法:
本脚本需要自行填入登陆用校园网账号和密码,
<USERNAME>
为用户名(学号),<PASSWORD>
为密码sudo chmod +x ./autologin.sh
nohup ./autologin.sh &
I'm not responsible for your environment or safety.