From c0e70abe6d0b159cc42ac2de54e0d7c88c48b054 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 29 Jun 2023 10:40:31 +0800 Subject: [PATCH] Update install_dev.sh --- scripts/install_dev.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 26ad3e800..ce3ad9a22 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -60,20 +60,22 @@ else fi +# HTTP_PREFIX="https://" +# LOCAL_ADDR=common +# ping -c 1 github.com > /dev/null 2>&1 +# if [ "$?" != "0" ];then +# LOCAL_ADDR=cn +# HTTP_PREFIX="https://ghproxy.com/" +# fi + +cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"") HTTP_PREFIX="https://" LOCAL_ADDR=common -ping -c 1 github.com > /dev/null 2>&1 -if [ "$?" != "0" ];then +if [ ! -z "$cn" ];then LOCAL_ADDR=cn - HTTP_PREFIX="https://ghproxy.com/" + HTTP_PREFIX="https://ghproxy.com/" fi -# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") -# HTTP_PREFIX="https://" -# if [ ! -z "$cn" ];then -# HTTP_PREFIX="https://ghproxy.com/" -# fi - if [ $OSNAME != "macos" ];then mkdir -p /www/server mkdir -p /www/wwwroot