Created
June 4, 2022 12:35
-
-
Save xuzh0u/b3e81cb0f9041807dd6ee8ac5d13676c to your computer and use it in GitHub Desktop.
如何在Linux系统尽可能保证UCAS校园网不断连?
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/bash | |
while true | |
do | |
loss_rate=$(ping www.baidu.com -c 4 | grep "packet loss" | awk -F, {'print$3'} | cut -d' ' -f2) | |
if [ "$loss_rate" != "0%" ] | |
then | |
nmcli conn up UCAS | |
# PUT YOUR CURL COMMAND HERE 去用浏览器开发者工具的 network 面板找到提交表单的请求,copy as CURL 然后粘贴到这里 | |
fi | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment