Skip to content

Instantly share code, notes, and snippets.

@nonefffds
Last active May 6, 2022 01:21
Show Gist options
  • Save nonefffds/bd91a9a2fc7a093edeb56d548560378c to your computer and use it in GitHub Desktop.
Save nonefffds/bd91a9a2fc7a093edeb56d548560378c to your computer and use it in GitHub Desktop.
Autologin to school network (自动登录学校校园网)
#!/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
@nonefffds
Copy link
Author

nonefffds commented May 4, 2022

使用环境&需求:
环境: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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment