Update update_dev.sh

pull/420/head
midoks 2 years ago
parent 3c6adfbd44
commit 21e9d8f2d8
  1. 18
      scripts/update_dev.sh

@ -54,15 +54,23 @@ else
OSNAME='unknow' OSNAME='unknow'
fi fi
# cn=$(curl -fsSL -m 10 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
# 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://" HTTP_PREFIX="https://"
LOCAL_ADDR=common LOCAL_ADDR=common
ping -c 1 github.com > /dev/null 2>&1 if [ ! -z "$cn" ];then
if [ "$?" != "0" ];then
LOCAL_ADDR=cn LOCAL_ADDR=cn
HTTP_PREFIX="https://ghproxy.com/" HTTP_PREFIX="https://ghproxy.com/"
fi fi
CP_CMD=/usr/bin/cp CP_CMD=/usr/bin/cp
if [ -f /bin/cp ];then if [ -f /bin/cp ];then
CP_CMD=/bin/cp CP_CMD=/bin/cp
@ -78,7 +86,7 @@ if [ "$LOCAL_ADDR" != "common" ];then
rm -rf /tmp/master.zip rm -rf /tmp/master.zip
rm -rf /tmp/mdserver-web rm -rf /tmp/mdserver-web
else else
curl --insecure -sSLo /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip curl --insecure -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
cd /tmp && unzip /tmp/dev.zip cd /tmp && unzip /tmp/dev.zip
$CP_CMD -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web $CP_CMD -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web
rm -rf /tmp/dev.zip rm -rf /tmp/dev.zip

Loading…
Cancel
Save