Skip to content

Instantly share code, notes, and snippets.

@Ran-Xing
Last active August 2, 2023 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ran-Xing/5815e43128e3fa6a95590046f3ef5f7f to your computer and use it in GitHub Desktop.
Save Ran-Xing/5815e43128e3fa6a95590046f3ef5f7f to your computer and use it in GitHub Desktop.
testNetWork.sh
if curl -s -m 5 -o /dev/null -w "%{http_code}" www.google.com | grep -q "200"; then
echo "true"
else
echo "false"
fi
@Ran-Xing
Copy link
Author

Ran-Xing commented Jul 19, 2023

if curl -s -m 5 -o /dev/null -w "%{http_code}" www.google.com | grep -q "200"; then
   ghproxy="https:/"
else
   ghproxy="https://ghproxy.com/https:/"
fi

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