From f161f24253cbbf35ce1b0b6417d34c73ba3c0230 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 18 Feb 2023 22:44:42 +0800 Subject: [PATCH] up --- scripts/install.sh | 2 +- scripts/install_dev.sh | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 8b8fdb506..f8faf89e3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -72,7 +72,7 @@ if [ $OSNAME != "macos" ];then # https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh - cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") + cn=$(curl --insecure -fsSL -m 10 https://ipinfo.io/json | grep "\"country\": \"CN\"") if [ ! -d /www/server/mdserver-web ];then if [ ! -z "$cn" ];then diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index b19a3c7a6..824c854a9 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -60,6 +60,13 @@ else fi +HTTP_PREFIX="https://" +ping github.com -t 1 +if [ "$?" != "0" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + + if [ $OSNAME != "macos" ];then mkdir -p /www/server mkdir -p /www/wwwroot @@ -68,7 +75,7 @@ if [ $OSNAME != "macos" ];then mkdir -p /www/backup/site if [ ! -d /www/server/mdserver-web ];then - curl -sSLo /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip + curl -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip cd /tmp && unzip /tmp/dev.zip mv -f /tmp/mdserver-web-dev /www/server/mdserver-web rm -rf /tmp/dev.zip @@ -94,12 +101,12 @@ fi echo "use system version: ${OSNAME}" 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 - curl -fsSL ${HTTP_PREFIX}https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash + # 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}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash else cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh fi