diff --git a/scripts/install.sh b/scripts/install.sh index bf3b80246..5d5be26bf 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -106,7 +106,16 @@ fi echo "use system version: ${OSNAME}" -cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh + +if [ "${OSNAME}" == "macos" ];then + 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 +else + cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh +fi if [ "${OSNAME}" == "macos" ];then echo "macos end" diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index a58b05ad1..0e4ac70d5 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -94,9 +94,12 @@ fi echo "use system version: ${OSNAME}" if [ "${OSNAME}" == "macos" ];then - USER=$(who | sed -n "2,1p" |awk '{print $1}') - DEV="/Users/${USER}/Desktop/mwdev" - cd $DEV && bash scripts/install/${OSNAME}.sh + 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 + curl -fsSL ${HTTP_PREFIX}https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash else cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh fi